in reply to best practices for a complex sort + splitting an alphanumeric string
This is separate enough from my previous reply that I thought I'd reply again. Hopefully I don't get too annoying. ;-)
The code above gives me my desired result with my existing data set. In case that changes in the future, I'm trying to figure out how to split "Fa10/0/1" into [Fa, 10, 0, 1] but all my ideas involve substrings & splits & freaky array manipulations and quickly get very ugly. Ideas?
@a = $a =~ /( [[:alpha:]]+ | [[:digit:]]+ )/gx; @b = $b =~ /( [[:alpha:]]+ | [[:digit:]]+ )/gx;
|
|---|