in reply to Re^2: push foreach glob - bug?
in thread push foreach glob - bug?
I was expecting to get something from using the return value of /ad/ as an array index
You got lucky.
On failure, when called in scalar context, it happens to return a value that's both the number zero and the empty string.
On success, when called in scalar context, it happens to return 1.
Both results are undocumented and unreliable. You're only guaranteed to get a true or false value.
should be$f[ /.../ ]
$f[ /.../ ? 1 : 0 ]
|
---|
In Section
Seekers of Perl Wisdom