Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^2: help with sprintf

by mhearse (Chaplain)
on Jun 20, 2012 at 16:57 UTC ( #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);

Comment on Re^2: help with sprintf
Download Code
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 (Monsignor) 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?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2015-11-27 00:12 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (710 votes), past polls