http://www.perlmonks.org?node_id=965845


in reply to Re: Why are elements of my array getting deleted?
in thread Why are elements of my array getting deleted?

Not sure if this will work...

What led you to believe it might? (I think you might say "Because I understand that accessing elements of @_ directly exhibits aliasing behavior." Fortunately, assignment of those elements performs a copy of the value of each element, so the only difference between direct assignment of indexed element and shift is that the latter updates the container—@_— as well.)