Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Re: Reliability on $0

by smokemachine (Hermit)
on Nov 07, 2006 at 17:24 UTC ( [id://582700] : note . print w/replies, xml ) Need Help??

in reply to Reliability on $0

a file named -e can exist! and can be used by perl... the -f realy can answer if this is a file or not... to use the file named you can use perl -- -e
echo 'print "Is a file" if -f $0' > -e
perl -- -e prints "Is a file"
and perl -e 'print "Is a file" if -f $0' don't...

Replies are listed 'Best First'.
Re^2: Reliability on $0
by Articuno (Beadle) on Nov 08, 2006 at 13:39 UTC
    Both commands print "Is a file" Even if you use "perl -e", the -e file still exists (i didn't saw a "rm -- -e" in your post )
    -- 6x9=42