cgmd has asked for the wisdom of the Perl Monks concerning the following question:
I'm unable to get a clear understanding of how the Boolean operators work in the following script:
#!/usr/bin/perl $pgm1 = "ls -l ."; $pgm2 = "ls -l /tmp/bogus/directory"; system ($pgm1) || print "program 1 succeeded\n"; system ($pgm2) && print "program 2 failed\n";
By my impaired thinking, I thought system ($pgm1) would deliver true and print "program 1 succeeded\n" would, in turn, not be carried out following the || (or) operator.
Please tell me where my thinking is wrong?
Thanks!
|
|---|