Help for this page

Select Code to Download


  1. or download this
    while (@one) {
       push(@two, pop(@one));
    }
    
  2. or download this
    my @b = reverse(@a);
    
    ...
    my @b = @a[ sub { my @rv; push(@rv, pop()) while @_; return @rv }->(0.
    +.$#a) ];
    
    my @b = @a[ sub { my @rv; unshift(@rv, shift()) while @_; return @rv }
    +->(0..$#a) ];