Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: determine the variable causing the error: Use of uninitialized value

by LanX (Sage)
on Apr 13, 2017 at 20:30 UTC ( #1187877=note: print w/replies, xml ) Need Help??


in reply to Re^2: determine the variable causing the error: Use of uninitialized value
in thread determine the variable causing the error: Use of uninitialized value

OK I was able to reproduce (some of) your problems in 5.14 ... that's indeed pretty inconsistent.

As a first step we should check if newer versions still have these problems.

use strict; use warnings; warn "version $]"; my %hash=(a=>undef,b=>[]); my $h=\%hash; my @array=({a=>undef}); my $a=\@array; warn "hash $hash{a}"; warn "hoa $hash{b}[0]"; warn "hashref $h->{a}"; warn "hoa ref $h->{b}[0]"; warn "array $array[1] "; warn "aoh $array[0]{a} "; warn "array ref $a->[1] "; warn "aoh ref $a->[0]{a} ";

version 5.014002 at /home/lanx/pm/warn_undef.pl line 4. Use of uninitialized value $hash{"a"} in concatenation (.) or string a +t /home/lanx/pm/warn_undef.pl line 13. hash at /home/lanx/pm/warn_undef.pl line 13. Use of uninitialized value in concatenation (.) or string at /home/lan +x/pm/warn_undef.pl line 14. hoa at /home/lanx/pm/warn_undef.pl line 14. Use of uninitialized value in concatenation (.) or string at /home/lan +x/pm/warn_undef.pl line 16. hashref at /home/lanx/pm/warn_undef.pl line 16. Use of uninitialized value in concatenation (.) or string at /home/lan +x/pm/warn_undef.pl line 17. hoa ref at /home/lanx/pm/warn_undef.pl line 17. Use of uninitialized value $array[1] in concatenation (.) or string at + /home/lanx/pm/warn_undef.pl line 19. array at /home/lanx/pm/warn_undef.pl line 19. Use of uninitialized value in concatenation (.) or string at /home/lan +x/pm/warn_undef.pl line 20. aoh at /home/lanx/pm/warn_undef.pl line 20. Use of uninitialized value in concatenation (.) or string at /home/lan +x/pm/warn_undef.pl line 22. array ref at /home/lanx/pm/warn_undef.pl line 22. Use of uninitialized value in concatenation (.) or string at /home/lan +x/pm/warn_undef.pl line 23. aoh ref at /home/lanx/pm/warn_undef.pl line 23.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^4: determine the variable causing the error: Use of uninitialized value
by LanX (Sage) on Apr 13, 2017 at 21:14 UTC
    tested in 5.22 with same results

    version 5.022000 at pm/warn_undef0.pl line 4. Use of uninitialized value $hash{"a"} in concatenation (.) or string a +t pm/warn_undef0.pl line 13. hash at pm/warn_undef0.pl line 13. Use of uninitialized value in concatenation (.) or string at pm/warn_u +ndef0.pl line 14. hoa at pm/warn_undef0.pl line 14. Use of uninitialized value in concatenation (.) or string at pm/warn_u +ndef0.pl line 16. hashref at pm/warn_undef0.pl line 16. Use of uninitialized value in concatenation (.) or string at pm/warn_u +ndef0.pl line 17. hoa ref at pm/warn_undef0.pl line 17. Use of uninitialized value $array[1] in concatenation (.) or string at + pm/warn_undef0.pl line 19. array at pm/warn_undef0.pl line 19. Use of uninitialized value in concatenation (.) or string at pm/warn_u +ndef0.pl line 20. aoh at pm/warn_undef0.pl line 20. Use of uninitialized value in concatenation (.) or string at pm/warn_u +ndef0.pl line 22. array ref at pm/warn_undef0.pl line 22. Use of uninitialized value in concatenation (.) or string at pm/warn_u +ndef0.pl line 23. aoh ref at pm/warn_undef0.pl line 23.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1187877]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2022-05-16 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (63 votes). Check out past polls.

    Notices?