Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to sort the data in Array which has format MMYY

by hdb (Parson)
on Jul 02, 2013 at 08:10 UTC ( #1041975=note: print w/ replies, xml ) Need Help??


in reply to How to sort the data in Array which has format MMYY

You could turn the format from MMMYY into YYMM and then sort numerically. The following sub also takes care or the capitalization issue and fits into your original post:

sub by_month { ($a=~/(...)(..)/,sprintf('%02d%02d',$2,$mon->{ucfirst lc $1})) <=> ($b=~/(...)(..)/,sprintf('%02d%02d',$2,$mon->{ucfirst lc $1})); }


Comment on Re: How to sort the data in Array which has format MMYY
Download Code
Re^2: How to sort the data in Array which has format MMYY
by kum@12 (Initiate) on Jul 02, 2013 at 14:38 UTC
    Hi Masters,

    Thanks for the help, please suggest me as i am new to perl programming, where can i learn the perl from basics, any links or online books

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (17)
As of 2014-07-29 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (223 votes), past polls