i have 2 identical Linux boxes.
Maybe you do or maybe they are not actually identical after all. Anyway, to avoid contamination by anything else going on in your script try running this one-liner on both boxes.
perl -e '($z) = grep (/b/, "foo", "bar"); print "z is $z\n";'If box 2 says "z is 1" instead of "z is bar" then start comparing things between the two boxes: perl versions, environment vars, shell versions, etc.
In reply to Re: grep in list context behaves as scalar context
by hippo
in thread grep in list context behaves as scalar context
by pedrete
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |