|XP is just a number|
Re^3: shift doesnt shiftby SuicideJunkie (Vicar)
|on Nov 27, 2008 at 14:03 UTC ( #726413=note: print w/replies, xml )||Need Help??|
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.
In Section Seekers of Perl Wisdom