Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Empty files in perl

Status
Not open for further replies.

Haazi2

Programmer
Aug 25, 2000
51
US
How do you determine if a file is empty in perl? You can use -s but it only counts the number of bytes. The file may have some bytes but for practical purposes it's still empty. Thanks in advance for any help offered.
 
when I iterate through my file I'm using a loop
<do {}unitl eof;> I suppose you could check for eof beforehand. Also I know the $. variable contains the number of lines that are written in the file you could check if that is 0?
Kris
kmcculler@portiva.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top