neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
Greetings,
This code is producing continuous errors. What have I done wrong?
Use of uninitialized value $i in array element at /home/neil/src/perltest/foo.pl line 25. label kept
#!/usr/bin/perl use strict; use warnings; use feature 'say'; my $aref = [ [ 'kept', 82 ], [ 'notkept', 1 ], [ 'repaired', 3 ] ]; say Dumper $aref; foreach my $i ( @{ $aref } ) { say "label ". $aref->[$i][0]; }
Neil Watson
watson-wilson.ca
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Dereference anonymous AoA
by Solo (Deacon) on Aug 08, 2014 at 15:26 UTC | |
Re: Dereference anonymous AoA
by AnomalousMonk (Archbishop) on Aug 08, 2014 at 16:39 UTC | |
Re: Dereference anonymous AoA
by ikegami (Patriarch) on Aug 08, 2014 at 21:28 UTC | |
Re: Dereference anonymous AoA
by Anonymous Monk on Aug 08, 2014 at 19:41 UTC |
Back to
Seekers of Perl Wisdom