Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: -s switch in perl

by philipbailey (Chaplain)
on Jul 29, 2009 at 17:03 UTC ( #784294=note: print w/ replies, xml ) Need Help??


in reply to -s switch in perl

It is also worth mentioning that using -s in the manner shown is equivalent to:

if (-e /tmp/xyz && !-z /tmp/xyz) {}

i.e. it checks both that the file exists and has non-zero size, which can be useful.


Comment on Re: -s switch in perl
Download Code
Replies are listed 'Best First'.
Re^2: -s switch in perl
by graff (Chancellor) on Jul 30, 2009 at 05:22 UTC
    I think you meant to say:
    if ( -e "/tmp/xyz" && ! -z _ ) {}
    (quotes around file name, and use of "_" to re-use the most recent stat results, rather than using stat twice in a row on the same file).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-07-08 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls