Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: push foreach glob - bug?

by ikegami (Patriarch)
on Jan 14, 2010 at 02:00 UTC ( #817324=note: print w/replies, xml ) Need Help??

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.

$f[ /.../ ]
should be
$f[ /.../ ? 1 : 0 ]

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://817324]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2022-12-04 08:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found