in reply to Re^2: Array confusion.
in thread Array confusion.
@c = map pop @a, @a;;
Much simpler, true, but destructive if that is a concern.
johngg@shiraz:~/perl > perl -Mstrict -Mwarnings -E ' my @arr = ( q{a} .. q{z} ); my @rev = map pop @arr, @arr; say qq{@arr}; say qq{@rev};' z y x w v u t s r q p o n m l k j i h g f e d c b a
Cheers,
JohnGG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Array confusion.
by BrowserUk (Patriarch) on Feb 15, 2017 at 11:52 UTC |