in reply to sprintf and arrays of unknown (in advance) length

Your question suggests that you expect sprintf formats to work like FORTRAN. They do not. It took me a long time to discover lnict's solution.

UPDATE: Corrected terminology. Thanks Hippo.

Bill
  • Comment on Re: sprintf and arrays of unknown (in advance) length

Replies are listed 'Best First'.
Re^2: sprintf and arrays of unknown (in advance) length
by hippo (Archbishop) on Oct 12, 2018 at 13:06 UTC

    Note that Perl formats and sprintf are entirely different things. While the latter does not behave like Fortran with respect to repetition and numbers of arguments, the former is arguably somewhat closer.

    You may also be interested in Fortran::Format and Fortran::F90Format.