in reply to Seperating values with spaces in array

In the case you want leading zeroes on the elements of @indexes, either put the leading zeroes on the elements before printing, or while printing them:

... push @indexes, sprintf '%03d', first_index { $_ eq $place } @first +Text; ...

or

print sprintf "%08d\n", $_ for @indexes;

Replies are listed 'Best First'.
Re^2: Seperating values with spaces in array
by RuZombieSlayer (Novice) on Jan 17, 2016 at 12:01 UTC
    Thank you! this fixed it! I thought %06d would be the solution but i didnt know how to properly implement it. Thank you
      ... i didnt know how to properly implement it.

      Please see detailed discussion of printf and sprintf format specifiers in sprintf docs. (See also
          perldoc -f sprintf
      from the command line.)


      Give a man a fish:  <%-{-{-{-<