On Thu Aug 11 23:04:35 2005, tassilo.von.parseval@rwth-aachen.de wrote: > ----------------------------------------------------------------- > > It appears that perl (any perl between 5.5.4 and 5.9.3) wont always > warn when > an undefined value is used as an argument: > > perl -we 'print lc(undef)' > > There will be no uninitialized-value-warning with (at least) > (lc|uc)(_first)? > and reverse in scalar context. > > ----------------------------------------------------------------- lc, uc, lcfirst and ucfirst already warn in blead. ./perl -wle 'my $v;$_ = lc $v;$_ = uc $v;$_ = lcfirst $v;$_ = ucfirst $v;' Use of uninitialized value $v in lc at -e line 1. Use of uninitialized value $v in uc at -e line 1. Use of uninitialized value $v in lcfirst at -e line 1. Use of uninitialized value $v in ucfirst at -e line 1. A patch that adds a warnings for reverse: ./perl -wle 'my $r1;$_=undef;$_=reverse;$_=reverse $r1;' Use of uninitialized value in reverse at -e line 1. Use of uninitialized value $r1 in reverse at -e line 1 Also in the patch is a test to see that reverse "foo", undef, "bar" warns: (this warning was already there, becaues it uses do_join which warns on undef, but it wasn't being tested (AFAICT)) ./perl -wle 'my $r1;$_=reverse "foo", $r1, "bar";' Use of uninitialized value $r1 in reverse at -e line 1 Doesn't warn on: ./perl -wle 'my $r1;my @a=reverse "foo", $r1, "bar";' (which is what I expect) Kind regards, BramThread Next