in reply to Simple sort query

If your data matches /^d(\d+)$/:
@sorted = sort { substr($a, 1) <=> substr($b, 1) } @data
If your data matches /^(\D+)(\d+)$/:
use Sort::Key::Multi qw(si_keysort); # "si" indicates that the sorting keys # are a string and an integer my @sorted = si_keysort { /^(\D*)(\d*)$/ } @data;

Replies are listed 'Best First'.
Re^2: Simple sort query
by Anonymous Monk on Apr 24, 2010 at 12:31 UTC
    This is really a reply to all who kindly and helpfully answered.
    How can this be extended when there is a variable number of alpha characters before any numeric ones?
      The solution provided by Perlbotics extends to values where there is at least a non-numeric character followed by at least a numeric character.

      You can change it to something else by changing the regular expression (and the anonymous subroutine provided to sort, if required).