Benjamin Jeeves, You can probably figure this out. Try running the code below supplying whatever file name you choose to save it as for an argument.
#!/usr/bin/perl -w use strict; my $filein = $ARGV[0]; print "$filein\n"; open(FILEIN, $filein); my $counter = 0; my $counter1; &start; sub start { for(;;) { while ( <FILEIN> ) { build_db(); $counter++; alert(); $counter1++; print "$counter..$counter1\n\t\t$_"; exit if $counter > 2; } sleep 2; seek(FILEIN,0,1); } } sub alert { while( <FILEIN> ) { print"Alert called\n\t$_"; } } sub build_db { print"build_db called\n"; } HTH -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]