in reply to How to avoid "Use of uninitialized value" with printf?
:) Please don't describe things your posted code doesn't demonstrate :)
You pretty much right about what happens, you can disable those warnings with no warnings q{uninitialized};
$ perl -le " use strict; use warnings; printf qq{%-12s %-12s\n}, @ARGV + " Missing argument in printf at -e line 1. Missing argument in printf at -e line 1. $ perl -le " use strict; use warnings; printf qq{%-12s %-12s\n}, @ARGV + " what Missing argument in printf at -e line 1. what $ perl -le " use strict; use warnings; printf qq{%-12s %-12s\n}, @ARGV + " what what what what $ perl -le " use strict; use warnings; use diagnostics; printf qq{%-12 +s %-12s\n}, @ARGV " Missing argument in printf at -e line 1 (#1) (W uninitialized) A printf-type format required more arguments tha +n were supplied. $ perl -le " use strict; use warnings; no warnings q{uninitialized}; p +rintf qq{%-12s %-12s\n}, @ARGV " $ perl -le " use strict; use warnings; no warnings q{uninitialized}; p +rintf qq{%-12s %-12s\n}, @ARGV " oh oh $ perl -le " use strict; use warnings; no warnings q{uninitialized}; p +rintf qq{%-12s %-12s\n}, @ARGV " oh yeah oh yeah
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to avoid "Use of uninitialized value" with printf?
by bobdabuilda (Beadle) on Apr 11, 2012 at 02:46 UTC | |
by Anonymous Monk on Apr 11, 2012 at 08:56 UTC | |
by bobdabuilda (Beadle) on Apr 12, 2012 at 00:38 UTC | |
by Anonymous Monk on Apr 12, 2012 at 01:05 UTC |