Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: -s test option returns differently in some cases

by frogsausage (Sexton)
on Oct 14, 2013 at 09:13 UTC ( #1058152=note: print w/ replies, xml ) Need Help??


in reply to Re^3: -s test option returns differently in some cases
in thread -s test option returns differently in some cases

You won't believe it but...

print "# Command file is located at: $cmd_path\n" if (-e $cmd_path); # system("ls -l $cmd_path"); if (-s $cmd_path) {# $cmd_path) { print "Good to go"; } else { print "Failed: $!"; }

gives "Failed: No such file or directory"

print "# Command file is located at: $cmd_path\n" if (-e $cmd_path); system("ls -l $cmd_path"); if (-s $cmd_path) {# $cmd_path) { print "Good to go"; } else { print "Failed: $!"; }

gives "Good to go"

Same file, same code, same everything except that extra statement in between. An empty system(""); call does the same (works). Ideas?!


Comment on Re^4: -s test option returns differently in some cases
Select or Download Code
Replies are listed 'Best First'.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2015-08-04 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (59 votes), past polls