"Untested, but I usually get this stuff mostly right. :)"<br><br>I LOL'ed when I read this from the man who taught most of us perl.<br>:)<br><br><div class="gmail_quote">On Mon, Aug 30, 2010 at 7:39 PM, Randal L. Schwartz <span dir="ltr"><<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">>>>>> "Joel" == Joel Fentin <<a href="mailto:joel@fentin.com">joel@fentin.com</a>> writes:<br>
<br>
Joel> I've tried everything I can think of without success.<br>
Joel> my @A = ('aaa10.jpg','aaa9.jpg','bbb9.jpg','bbb10.jpg');<br>
<br>
Joel> The desired order:<br>
Joel> aaa9.jpg<br>
Joel> aaa10.jpg<br>
Joel> bbb9.jpg<br>
Joel> bbb10.jpg<br>
<br>
Joel> Sorted first by the text. Those with the same text sorted<br>
Joel> numerically.<br>
<br>
my @sorted =<br>
map $_->[0],<br>
sort { $a->[1] cmp $b->[1] or $a->[2] <=> $b->[2] }<br>
map [$_, /^(\D+)(\d+)/],<br>
@input;<br>
<br>
Untested, but I usually get this stuff mostly right. :)<br>
<font color="#888888"><br>
--<br>
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br>
<<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>> <URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>><br>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br>
See <a href="http://methodsandmessages.vox.com/" target="_blank">http://methodsandmessages.vox.com/</a> for Smalltalk and Seaside discussion<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
San-Diego-pm mailing list<br>
<a href="mailto:San-Diego-pm@pm.org">San-Diego-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/san-diego-pm" target="_blank">http://mail.pm.org/mailman/listinfo/san-diego-pm</a><br>
</div></div></blockquote></div><br>-- <br>Respectfully,<br>Chris Hart<br>Developer / System Administrator<br>Insuremonkey.com<br>2080 E. Flamingo, Suite 223<br>Las Vegas, NV 89119<br>