in reply to Perl Problems with Digit Precision Changing on the Printf Statement

define "won't work". what do you expect, and what do you get with that code snippet?

besides that, you might want to use the star *:
printf STDOUT ("\n%*s\n", $digitprecision, $value); for that.

  • Comment on Re: Perl Problems with Digit Precision Changing on the Printf Statement
  • Download Code

Replies are listed 'Best First'.
Re^2: Perl Problems with Digit Precision Changing on the Printf Statement
by EchoAngel (Pilgrim) on Jun 24, 2004 at 15:35 UTC
    i mean i want those two lines to output the same OUTPUT to screen. when i run
    printf STDOUT ("\n%*s\n", $digitprecision, $value);
    I get 'Use of * in printf format not supported at example.pl line 10'
      oh, i'm getting the same output (v5.8.0 linux at the moment).
      what perl version are you using?
      regarding %*s: i don't know since which perl version it is allowed...