in reply to How do I reverse array elements?

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Answer: How do I reverse array elements?
by blakem (Monsignor) on Aug 20, 2002 at 18:19 UTC
    If you are somehow reverse averse and want to swap the elements in place, you can do it all in one line:
    @arr[$_, -($_+1)] = @arr[-($_+1), $_] for 0..$#arr/2;

    -Blake