We don't bite newbies here... much | |
PerlMonks |
Re: How to goto new sub if file empty?by pfaut (Priest) |
on Apr 23, 2003 at 05:25 UTC ( [id://252454]=note: print w/replies, xml ) | Need Help?? |
If the file is empty, the first attempt to read from it returns false (undef) and you never execute the body of the while loop. Your call of &stopit is inside that body so it never gets called. You can check for an empty file with eof before executing the while.
In Section
Seekers of Perl Wisdom
|
|