in reply to printf and variables

That doesn't work because printf requires two arguments, a format string and a list of variables to coerce into the format. If you say printf $newarray (a rather odd choice of variable name, BTW) then you're only sending one argument to printf. You can do what you want by simply doing:

my $format = '%11s %3d %5.1f\n'; printf $format, 'Hello there', 123, $pi;

Replies are listed 'Best First'.
Re^2: printf and variables
by Anonymous Monk on Feb 13, 2005 at 22:35 UTC
    friedo / zaxo thanks....... much appreciated