in reply to Re: push with interpolated variable
in thread push with interpolated variable
It's not.is the same aspush (@array, $value);push @array, "$value";
#!/usr/bin/perl use strict; use warnings; my (@array, $value); @array = ("foo"); $value = []; push(@array, $value); $array[-1][0] = "bar"; print $array[-1][0], "\n"; @array = ("foo"); $value = []; push @array, "$value"; $array[-1][0] = "bar"; print $array[-1][0], "\n"; __END__ bar Can't use string ("ARRAY(0x818427c)") as an ARRAY ref while "strict re +fs" in use
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: push with interpolated variable
by holli (Abbot) on Jan 20, 2005 at 12:13 UTC |