in reply to Re: push undefined and vivification
in thread push undefined and vivification
actually append 'foo' to @bar:use Data::Dumper; @a=('bar'); print Dumper(\@a); push @{$a[0]}, "foo"; print Dumper(\@a); print Dumper(\@bar);
$VAR1 = [ 'bar' ]; $VAR1 = [ 'bar' ]; $VAR1 = [ 'foo' ];
in that case, so, perl do one of three things:
this may be a good reason to use strict, without perl may use the @{$something} as array-ref or variable name... a bit confusing, doesn't it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: push undefined and vivification
by Anonymous Monk on Jan 18, 2004 at 12:53 UTC |