Problems? Is your data what you think it is? | |
PerlMonks |
Re: Re: Creating a copy of an arrayby repson (Chaplain) |
on Dec 19, 2000 at 06:37 UTC ( [id://47316]=note: print w/replies, xml ) | Need Help?? |
How about:
my @second = map { [ @$_ ] ] @first;
That expands each element then creates a new array ref from it.
Without the slowdown of a subroutine call like you used.
Still there are modules that can do this better. Hell you could do this (not recommended, there are modules made for copying).
In Section
Seekers of Perl Wisdom
|
|