Just another Perl shrine | |
PerlMonks |
How to goto new sub if file empty?by Anonymous Monk |
on Apr 23, 2003 at 05:19 UTC ( [id://252453]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hey everyone :) I am very new to Perl and can't understand why I can't check to see if a file is empty in a while loop... I am building a page for my teacher to be able to change links on a school site anytime he wants through his browers. My script opens a file, reads the lines, splits the contents of the line into an array and displays them (not like you don't understand this already... don't mean to offend any of you :) ) Anyway, if the file is empty, I am trying to redirect to a subroutine called stopit..
What am I doing wrong? I thought I could check to see if the first part of the array has a value near the beginning og the while loop? I know the coding is very crude... please be gentle!!
Back to
Seekers of Perl Wisdom
|
|