fishy conditional expression



the following script:

if (@f = `cat nonExistentFile` ) {
print 1;
}

if (@f = `cat nonExistentFile` && (1==1)) {
print 2;
}

gets:

cat: nonExistentFile: No such file or directory
cat: nonExistentFile: No such file or directory
2

seems to me both print statements should be skipped. what am i missing?

tom arnall
north spit, ca


"Relax, the tests extend the compiler."

.



Relevant Pages

  • Re: fishy conditional expression
    ... are effectively saying is ... conditional statement. ... cat: nonExistentFile: No such file or directory ...
    (perl.beginners)
  • CMUCL "-script" hack now available
    ... CMUCL won't start up correctly.] ... $ cat script_header.cmucl ... If you want a script which just sets up an environment ... Welcome to the customized test REPL ...
    (comp.lang.lisp)
  • Re: Batch Cisco Configuration Script
    ... configuration of many routers but now I cannot find it unfortunately. ... The way the script would work is as follows. ... I can't use Kiwi Cat ... open telnet session. ...
    (comp.dcom.sys.cisco)
  • Re: script reports file not found
    ... any and all feedback on this script appreciated. ... when it's kicking out the cat of the file in question. ... primitive linux script to run some ruby stuff. ... why all the cat commands? ...
    (Fedora)
  • Re: My auth.log analyze script
    ... users on this group I decided to write my own auth.log analyzing script. ... rm $TMPFILE1 ... You don't need cat: ... # Sort out Unique IPs ...
    (alt.os.linux)