Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Converting output from numeric values to text

by cacharbe (Curate)
on Mar 28, 2002 at 21:31 UTC ( [id://155111]=note: print w/replies, xml ) Need Help??


in reply to Converting output from numeric values to text

*shrug*

You should be using ==, but how about something a little more direct:

my @mnths = qw(jan feb mar apr may jun jul aug sep oct nov dec); my ($month) = (localtime(time))[4]; my $New_mo = $mnths[$month]; print $New_mo;
C-.

update:I didn't even see the scope issue for the other two ideas and that was actually the reason nothing was getting into the output file. Even if you lost the "my" in your structures, however, you'd still get the wrong data in the file.

Replies are listed 'Best First'.
Re: Re: Converting output from numeric values to text
by cacharbe (Curate) on Mar 29, 2002 at 00:52 UTC
    Of course, you could also use one of the various Date::x modules as well.
    use Date::Calc qw(Month_to_Text); $string = Month_to_Text(((localtime(time))[4]+1)); print $string;
    C-.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-19 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found