in reply to Re^2: Unexpected warning
in thread Unexpected warning

I get no warnings from the code below:

use strict; use warnings; sub test { my $x = shift; } my %hash = ( a => "a" ); test $hash{"b"};

Replies are listed 'Best First'.
Re^4: Unexpected warning
by LanX (Saint) on Nov 18, 2013 at 15:15 UTC
    The key must be undef.

    lanx@nc10-ubuntu:~$ perl use strict; { use warnings; sub test { my $x = shift; } } my %hash = ( a => "a" ); my $key; test $hash{$key} Use of uninitialized value in scalar assignment at - line 3. lanx@nc10-ubuntu:~$ perl -version This is perl, v5.10.0 built for i486-linux-gnu-thread-multi

    I agree with salva that this is kind of a bug in lexical warnings.

    Cheers Rolf

    ( addicted to the Perl Programming Language)