note
ww
I'm with [johngg] on this.
<p>WHY are you doing something that looks like makework? If you need to sort customers by alpha (the only plausible reason for your spec that I've dreamed up), you can do that with the datestamp in its initial position. This 4th line of this code is lifted almost verbatim from the doc for <c>sort</c></p>
<c>my @old = qw(20120301Customer100 20120402Alsocust200 20130102Nothercu300);
my (@new, $item);
@new = sort { substr($a, 8) cmp substr($b, 8) } @old;
for $item(@new) {
say $item;
}</c>
<p>See <c>perldoc -f sort</c> and <c>perldoc -f substr</c>. But for best results (and as has been asked before) tell us what you really want to do and WHY you think you need to do that.</p>
1011248
1011248