Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

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

Q&A > files > How do I test whether a file has some contents or not? - Answer contributed by merlyn

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?

What's my password?
Create A New User
LanX Finally, there is a certain order or choreography to the greetings, which Kornhauser-Duda appears to have been following. First, the two heads of state shake hands, while the two first ladies do the same
[LanX]: FAKE NEWS , erix, so sad! Fired!

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-03-22 20:16 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (286 votes). Check out past polls.