Perl: the Markov chain saw | |
PerlMonks |
shift on empty array in list context brokenby LanX (Saint) |
on Jul 13, 2019 at 19:23 UTC ( [id://11102798]=perlquestion: print w/replies, xml ) | Need Help?? |
LanX has asked for the wisdom of the Perl Monks concerning the following question:
Why does a list context shift on an empty array return (undef) ? Shouldn't shift behave like one element splice
update motivationplease note how loops over shift can't handle false values in scalar context, but become endless in list context. This behaviour breaks conventions of other iterators ...
Cheers Rolf
Back to
Seekers of Perl Wisdom
|
|