Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Regex/Sort Questions

by moritz (Cardinal)
on Dec 05, 2007 at 18:02 UTC ( [id://655153]=note: print w/replies, xml ) Need Help??


in reply to Regex/Sort Questions

However the sort is choking (not sorting numerically) since it doesn't know how to deal with numbers like 01, 02, etc.

I don't think that is the problem, it should work fine.

You are sorting by day ($3) first, then by year ($1) and finally by month ($2) - is that really what you want?

BTW use \. in regexes to match a literal dot .

Update: fixed description of sort order

Replies are listed 'Best First'.
Re^2: Regex/Sort Questions
by logie17 (Friar) on Dec 05, 2007 at 18:22 UTC
    Yes, you are absolutely correct. Thank you for seeing the error in my logic - I knew there was a simple solution (oops).

    Thanks
    s;;5776?12321=10609$d=9409:12100$xx;;s;(\d*);push @_,$1;eg;map{print chr(sqrt($_))."\n"} @_;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-25 22:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found