PerlingTheUK has asked for the wisdom of the Perl Monks concerning the following question:
produced a "2".my @test = ( 0 ); if ( defined @{ $test[1] }[1] ){} my $l = @test; print $l;
and all is fine again, but where can I find any documentation of this behaviour? It was unexpected to me and I would like to read more about it. Neither perlref nor the perlreftut seemed to document that an element is appended to @test as soon as it is accessed.my @test = ( 0 ); if ( defined $test[1] && defined @{ $test[1] }[1] ){} my $l = @test; print $l;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: defined of a matrix
by pelagic (Priest) on Jun 15, 2004 at 12:43 UTC | |
by PerlingTheUK (Hermit) on Jun 15, 2004 at 12:55 UTC | |
|
Re: defined of a matrix
by rnahi (Curate) on Jun 15, 2004 at 13:03 UTC | |
by pelagic (Priest) on Jun 15, 2004 at 13:28 UTC | |
|
Re: defined of a matrix
by Roy Johnson (Monsignor) on Jun 15, 2004 at 14:50 UTC |