Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How do I test whether a file has some contents or not?

by merlyn (Sage)
on Oct 15, 2000 at 15:09 UTC ( #36805=note: print w/replies, xml ) Need Help??


in reply to How do I test whether a file has some contents or not?

Hmm, on the off chance that "contents" is not "text", and believing the description more than the title, I'd also add:
print "it's a non-empty text-ish file" if -s $file and -T $file;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://36805]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2022-05-28 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (98 votes). Check out past polls.

    Notices?