Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Replacing $mon with Jan, Feb, Mar by regex or other means

by gawatkins (Monsignor)
on Apr 25, 2003 at 11:49 UTC ( #253138=note: print w/replies, xml ) Need Help??

in reply to Replacing $mon with Jan, Feb, Mar by regex or other means


The best way that I have found to do this was using a hash.

my %month3letter = ( 12 => 'Jan', 1 => 'Feb', 2 => 'Mar', 3 => 'Apr', 4 => 'May', 5 => 'Jun', 6 => 'Jul', 7 => 'Aug', 8 => 'Sep', 9 => 'Oct', 10 => 'Nov', 11 => 'Dec' );

Or-well mabye I just like hashes, anyway I have had a great deal of success with it.



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://253138]
[PriNet]: go figure, i just tried that, it retains some of the values (not the key) of the pre-assigned value
[PriNet]: i guess i'll just have to use two seperate hashes, there are two, but one is larger than the other, and when i reference the smaller one, it holds onto the values that were assigned to the larger hash (the keynames change, but unless i reassign a new valu

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2017-06-28 02:58 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (619 votes). Check out past polls.