in reply to Re: Sorting text-number values
in thread Sorting text-number values
Perl ran but sadly did not give the sorted data at the end.my @data = qw{ this_5_string_12 some_12_garbage_23 this_5_string_8 17 this_5_string_23 some_12_garbage_6 102 this_5_string_19 5 this_5_string_101 }; my $width = 50; say for map { substr $_, 54 } sort map { do { no warnings qw{ uninitialized }; pack qq{A${width}NA*}, m{(.*\D)?(\d+)$}, $_; } } @data;
Can you tell me where it is stored and how to store this in an array? I did add lines to print out @data but that, probably as expected, gave me the what was stored with the ‘qw’ at the beginning of the code.
I have used Perl for many years but I have never got to grips with this sort of coding!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sorting text-number values
by Corion (Patriarch) on Nov 30, 2016 at 09:25 UTC | |
by merrymonk (Hermit) on Nov 30, 2016 at 10:12 UTC | |
by Corion (Patriarch) on Nov 30, 2016 at 10:16 UTC | |
by merrymonk (Hermit) on Nov 30, 2016 at 10:49 UTC | |
by hippo (Archbishop) on Nov 30, 2016 at 11:12 UTC | |
| |
by Corion (Patriarch) on Nov 30, 2016 at 11:21 UTC |