Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: push foreach glob - bug?

by ikegami (Patriarch)
on Jan 14, 2010 at 02:00 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2024-04-18 12:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found