Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: shift doesnt shift

by SuicideJunkie (Vicar)
on Nov 27, 2008 at 14:03 UTC ( [id://726413]=note: print w/replies, xml ) Need Help??


in reply to Re^2: shift doesnt shift
in thread shift doesnt shift

You wrote: X or Y
1) Y is evaluated when X is false
2) X is empty (aka undef, aka false)
1+2=3) Therefore Y (the die) is performed.

So, what is the problem here? It is doing exactly what you told it to. If you want it to die on some other condition than the shift giving 0/undef/''/etc, then you need to specify that condition in your code.

Try specifying what to shift: $var = shift @array to ensure you're shifting the right array.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-23 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found