Tag Archives: perl

Preventing flooding in Perl

I’m using a small Perl script to send SMS for Nagios notifications. Up to now I didn’t have any flood control (i. e. logic that limits the rate of messages to be sent) built into the script, which made me feel bad (especially since I had already been SMS-bombed a while ago when the link to the servers to be monitored broke down).

My search for some Perl sample code that implements flood control led me to an article on Perl.com and the CPAN Perl package Algorithm::FloodControl, which does exactly what I need and which is easy to use at the same time. I very much recommend this package.