Steve Bertrand wrote:
> Jo for lists and groups wrote:
>> How about this? Jo
> 
>> #!/usr/bin/perl
>>
>> use strict;
>> use warnings;
>>
>> my @list = qw/dog is a there/;
>> my @sortOrder = (3,1,2,0);
>> my @sorted;
>> foreach (@sortOrder) { push(@sorted,$list[$_]); }
>>
>> print "@sorted";
>> exit;
> 
> ...or this:
> 
> #!/usr/bin/perl
> use strict;
> use warnings;
> 
> my @list = map { qw(dog is a there)[$_]; } qw(3 1 2 0);
> print "@list";

Of course, it would likely be required to have the data in arrays first,
 so this is likely more feasible:

my @list  = qw (dog is a there);
my @order = qw (3 1 2 0);

@list = map { $list[$_]; } @order;

print "@list";

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to