in reply to sorting inside specific
Output:use strict; use warnings; my @data; # this will be an array of arrays while(<DATA>) # read from __DATA__ for simplicity { chomp; if($_ eq '<sep>') { push @data, [] } else { push @{$data[-1]}, $_ } } foreach (@data) { print "<sep>\n", join("\n", sort { $a <=> $b } @$_), "\n"; } __DATA__ <sep> 22 1 3 <sep> 4 2 44
<sep> 1 3 22 <sep> 2 4 44 Tool completed successfully
|
|---|