in reply to -s test option returns differently in some cases
You won't believe it but...
print "# Command file is located at: $myAbsPathToFile\n" if (-e $myAbs +PathToFile); # system("ls -l $myAbsPathToFile"); if (-s $cmd_path) {# $myAbsPathToFile) { print "Good to go"; } else { print "Failed: $!"; }
gives "Failed: No such file or directory"
print "# Command file is located at: $myAbsPathToFile\n" if (-e $myAbs +PathToFile); system("ls -l $myAbsPathToFile"); if (-s $cmd_path) {# $myAbsPathToFile) { 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). Is a hidden/builtin Perl variable messing up with it or something? Ideas?!
Sorry for the double post, I just posted in the wrong hierarchy :(
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: -s test option returns differently in some cases
by Anonymous Monk on Oct 14, 2013 at 09:32 UTC | |
by frogsausage (Sexton) on Oct 14, 2013 at 10:21 UTC | |
Re^2: -s test option returns differently in some cases
by Anonymous Monk on Oct 14, 2013 at 09:30 UTC | |
by frogsausage (Sexton) on Oct 14, 2013 at 09:38 UTC | |
Re^2: -s test option returns differently in some cases
by yitzchak (Sexton) on Oct 20, 2013 at 15:42 UTC |
In Section
Seekers of Perl Wisdom