Ask a Question related to PERL Beginners, Design and Development.
-
Ravi Malghan #1
copying a multidimensional array
Hi: whatz the best way to copy an multidimensional
array onto another. I have never used something like
clone, just want to know whatz the easiest route.
Thanks
Ravi
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
[url]http://antispam.yahoo.com/whatsnewfree[/url]
Ravi Malghan Guest
-
multidimensional array assignment
dear all, I am a facing a problem in multidimensional array. The problem is that when i am trying to copy the value of arry named 'str' to... -
copying a multidimensional array to $_SESSION
Probably a simple question but I can't find the answer anyway. Specifically, is it possible to copy a multidimensional array into the $_SESSION... -
Multidimensional array: see if 1st key is available
Hi, I've got an multidimensional array $ret = $country_code; Now I want to see if $countryCode is even in that array, because if it's not, it... -
Split multidimensional array into 4 multidimensional arrays
Hello everyone, I have a multidimensional array that I need to split into 4 multidimensional arrays. I've tried the examples from the... -
Sorting a Multidimensional Array
I have an array like this: $events = array( array( '2003-07-01', 'Event Title 1', '1' //ID Number (not unique) ), array( '2003-07-02', -
Steve Grazzini #2
Re: copying a multidimensional array
On Thu, Nov 13, 2003 at 10:06:19AM -0800, Ravi Malghan wrote:
Storable::dclone() is probably the easiest:> Hi: whatz the best way to copy an multidimensional
> array onto another. I have never used something like
> clone, just want to know whatz the easiest route.
use Storable qw(dclone);
my @x = ([0,1,2], [3,4,5]); # "multidimensional" array
my @y = @x; # shallow copy
my @z = @{ dclone(\@x) }; # deep copy
require Data::Dumper;
print Data::Dumper->Dump( [\(@x, @y, @z)], [qw(*x *y *z)] );
--
Steve
Steve Grazzini Guest



Reply With Quote

