in reply to Alarm::Queued

And so you can see it in action, here's a test/demonstration script for this module.

#!/usr/bin/perl -w # # Test of Alarm::Queued - Written by Cory Johns (c) 2001 # ++$|; BEGIN { # This will be saved and activated when # Alarm::Queued is imported. alarm(1); $SIG{ALRM} = sub { print "Legacy alarm." }; } use Alarm::Queued qw( :OVERLOAD :ALL ); setalarm(2, sub { print "bing" }); alarm(4); sethandler(sub { print "bong" }); # This alarm _must_ wait # for the previous one. setalarm(3, sub { print "!" }); MyPack::doalarm(); package MyPack; sub doalarm { # Alarm is overridden in _all_ namespaces. alarm(6); # $SIG{ALRM} has been taken over. # It now calls sethandler(). $SIG{ALRM} = sub { print "BANG!!!" }; } #*******************************************# package main; for(1..6) { print "Second $_... "; sleep 1; print "\n"; }

bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.