in reply to Re: printf and variables
in thread printf and variables

This is close to how I quite often do this very thing:

my $format = "Hello there %3d!"; my @data = (123); if (defined $pi) # if we've calculated pi ... { $format .= " %5.1f"; push @data, $pi; } printf "$format\n", @data;

Very useful to be able to do this. The above example specifically doesn't seem too useful, but the overall idea is quite useful. At least to me.