in reply to Re: keep track of array indexes
in thread keep track of array indexes
Or, slightly differently:
c:\@Work\Perl>perl -wMstrict -le "my @words = qw/this a sentence is/; my %dict = map { $_ => $words[$_] } 0 .. $#words; ;; my @order = (0, 3, 1, 2); print join ' ', map $dict{$_}, @order; " this is a sentence
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: keep track of array indexes
by theleftright (Novice) on Jan 02, 2016 at 20:40 UTC | |
by choroba (Cardinal) on Jan 02, 2016 at 20:58 UTC | |
by LanX (Saint) on Jan 03, 2016 at 05:08 UTC | |
by choroba (Cardinal) on Jan 03, 2016 at 17:58 UTC | |
by LanX (Saint) on Jan 03, 2016 at 18:03 UTC | |
by Cristoforo (Curate) on Jan 03, 2016 at 00:05 UTC |