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


in reply to Re: Re: (OT) Interview questions -- your response?
in thread (OT) Interview questions -- your response?

Well, technically, doesn't 0..$#array create an (anonymous) array, which reverse then reverses? :)
Technically no. The 0..$#array just creates a list from zero to the last index, reverse 0..$#array is the list of indices reversed. So we are not reversing the array, just creating a slice with with reversed indices and assigning that slice to the a slice with all the indices in order. I imagine a built-in array reversal would be more like Ruby's array.reverse! method.