in reply to Copying multi-dimensional array
Yep, dclone is about as simple as you're going to find.
use Storable qw(dclone); use Data::Dumper; use strict; use warnings; my @Array1 = ([10,15],[20,30]); my $Array2 = dclone(\@Array1); $Array1[0][1] = 71; # Does change translate? print Dumper($Array2); # Nope
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Copying multi-dimensional array
by rpike (Scribe) on Apr 21, 2011 at 14:56 UTC |