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.
In reply to Re^2: printf and variables
by Tanktalus
in thread printf and variables
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |