Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Sort array

by misc (Friar)
on Mar 11, 2020 at 18:55 UTC ( [id://11114139]=note: print w/replies, xml ) Need Help??


in reply to Sort array

My few cents..

@arrayUnsorted=('page1.html', 'page11.html', 'page2.html', 'page3.html +'); my @a = sort{ ($a.$b)=~/(\d*)\.htmlpage(\d*)/;$1<=>$2; } @arrayUnsorte +d; print "$_\n" foreach @a;

probably it might be better looking in the regex for /^page(\d*) ...
Best wishes

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11114139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-19 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found