in reply to Re: Sort based on a delimited field in array elements without affecting original array elements
in thread Sort based on a delimited field in array elements without affecting original array elements
You can do this with C++ templates. How, though, in Perl, though without using eval or sacrificing the value of warnings when passing bad function names?my @blobs = map { $_->[0] } sort {$a->[1] cmp $b->[1] } map { [$_, $_->property_foo()] } @blob_list; my @flobs = map { $_->[0] } sort {$a->[1] cmp $b->[1] } map { [$_, $_->function_bar()] } @flob_list;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: Sort based on a delimited field in array elements without affecting original array elements
by I0 (Priest) on Mar 01, 2002 at 23:47 UTC |