in reply to help with sprintf

@list=map {$_.="00"}("00".."23"); print join("\n",@list);
Why specifically sprintf?

Replies are listed 'Best First'.
Re^2: help with sprintf
by mhearse (Chaplain) on Jun 20, 2012 at 16:57 UTC
    The only reason is that I want those hours in an array:
    my @times; for (0..23) { push @times, sprintf "%02d00", $_; } print Dumper(\@times);

        I suppose you meant

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

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