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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|