Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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.

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://784294]
[Corion]: You say the girls may strip with your permission, You draw the line dividing art from sin :-D
[ambrus]: Corion: I didn't want to start this particular computer up, I took this one away so that I can put the other computer I want to start up in its place, but that probably doesn't make much of a difference.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-01-16 19:52 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (151 votes). Check out past polls.