Subject: | Not warnings safe with normal usage |
It seems to me that this test should not throw warnings:
$ perl -MIO::Prompt -we '$p = prompt(-p=>"Password: " -e => "*"
); print $p'
Use of uninitialized value $_ in pattern match (m//) at
/usr/local/lib/perl5/site_perl/5.10.0/IO/Prompt.pm line 92.
Use of uninitialized value $_ in pattern match (m//) at
/usr/local/lib/perl5/site_perl/5.10.0/IO/Prompt.pm line 92.
Also, the line number reported is weird:
$ cat -n /usr/local/lib/perl5/site_perl/5.10.0/IO/Prompt.pm | head -100
| tail -10
91 local *_ = \($data[$i]);
92 if (ref eq 'HASH') {
93 splice @data, $i + 1, 0, %$_;
94 }
95 elsif (ref eq 'GLOB' or UNIVERSAL::isa($_, 'IO::Handle')) {
96 croak "Can't write prompt to read-only $_" unless -w;
97 $OUT = $_;
98 }
99 elsif (/^-/) { # a flag
100 s/_//g;