Use of unitialised gubbins c/w Brainbench

Nicholas Clark nick at
Thu Dec 7 14:17:09 GMT 2006

On Thu, Dec 07, 2006 at 05:31:42AM -0800, Stray Taoist wrote:
> Hey, scenesters. How goes it?
> Two questions. Or, for those who remember vinyl, and spotted the topic, one
> question and a b-side.
> OK, this came up recently, or I was asked, so I thought I would posit it to
> you lot.
> Imagine someone had a big, mad sprintf, with loads of variables. You know,
> like:
> my $compound = sprintf "%s-%s.%s %etcetc", $foo, $bar, $baz, @etc;
> This is buried in a sub that is called via a sub that is buried in a sub that
> is called and so on. And it all passes everything along. *sigh* I know.
> My (A side) question is this (see, I got to it eventually)
> If it gives a 'use of uninitialised variable' warning, is there anyway
> (without lots of debugging warns) for me to change the output of the warning
> to say 'Variable 'foo' was uninitialised at line blah'?

Try using bleadperl. Where it can, it names the variable. This is all Dave
Mitchell's "fault".

Nicholas Clark

More information about the mailing list