in reply to Re: Re: How to sort hash tables alpha-numeric
in thread How to sort hash tables alpha-numeric

The Schwartzian Transform is explained here by the person after who this sorting technique is named.

A modified version of the sorted routine which also takes the leading letters into account:

sub sorted { return map { $_->[0] } sort { $a->[1] cmp $b->[1] || $a->[2] <=> $b->[2] || $a->[3] <=> $b->[3] } map { [ $_, (/([A-Z]+)(\d+)(?:-(\d+)){1,2}/) ] } @_; }
The split function is replaced by a regex which returns a list of letters and the numbers.

Arjen