Mailing List Archive

-w noise in getopts.pl on normal use
Use of uninitialized value at /usr/local/lib/perl5/getopts.pl line 18.

This happens when I call "perl -w this_program -i" on this program here:

require 'getopts.pl';
Getopts('i') || die "bad usage";
print "got it" if $opt_i;

The work-around for the nonce is:


require 'getopts.pl';
{
local $^W = 0;
Getopts('i') || die "bad usage";
}
print "got it" if $opt_i;

but it should be fixable.

--tom

Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
"Some people think abstraction makes things easier, while others think it
makes things harder. It depends on whether you like to think about things."
--Larry Wall