in reply to Re^10: Sort problemsin thread Sort problems
No, I'm the one who wasn't paying enough attention or testing his stuff X_X. I wasn't calculating the right length.
print("$_\n") for map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { my $s = $_; $s =~ s/(?<![\[\d])(\d+)/ sprintf('%010u%s', length($1), $1) /eg; $s =~ s/(?<=\[)(\d+)/ sprintf('%010u', 4294967296-$1) /eg; [ $_, $s ] } do { local $/; split ' ', <DATA> }; [download]
I tested it this time!