Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: help with sprintf

by mhearse (Chaplain)
on Jun 20, 2012 at 16:57 UTC ( [id://977411]=note: print w/replies, xml ) Need Help??


in reply to Re: help with sprintf
in thread help with sprintf

The only reason is that I want those hours in an array:
my @times; for (0..23) { push @times, sprintf "%02d00", $_; } print Dumper(\@times);

Replies are listed 'Best First'.
Re^3: help with sprintf
by MidLifeXis (Monsignor) on Jun 20, 2012 at 17:04 UTC
Re^3: help with sprintf
by jwkrahn (Abbot) on Jun 20, 2012 at 21:51 UTC

      I suppose you meant

      my @times = map "${_}00", '00' .. '23';

      ($_00 is a valid variable name, which interpolates to nothing)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-19 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found