#!/usr/bin/perl # Sample program for the ChronicProxy sample. # Copyright 2004 by Rocco Caputo. Free software. # Same terms as Perl itself. Have fun! use warnings; use strict; use ChronicProxy; # Create a new recurring callback object. my $ticker_obj = ChronicProxy->new( Callback => \&poit, Interval => 1, ); my $count = 0; # Perform some regular task. Stop when enough # work has been done. sub poit { print "Poit #", ++$count, "\n"; $ticker_obj->stop() if $count >= 5; } # Run the timers. Otherwise nothing will happen. ChronicProxy->run(); exit;