Thanks! My script seems to work with dclone.

Though the (deep) recursion takes a lot of time ...
What is your opinion, would it pay off (in performance) when I rewrite the 
script in such a way that I do not use dclone, but string manipulation routines 
instead? So:
 - passing a single dimension array containing 16 elements with 16-character 
strings and doing substr()
 - instead of passing a 2 dimensional (16x16) array passing 1-character strings 
and doing dclone
Every pass I only change a single character, then I run some tests and so on.

On 10/16/2011 04:05 AM, Shawn H Corey wrote:
On 11-10-15 07:44 PM, Rob Dixon wrote:

   sub try {
     my @b;
     foreach my $row (@_) {
       push @b, [@$row];
     }
     :
   }


Or you could use dclone() from Storable:

  use Storable qw( dclone );

  sub try {
    my @b = @{ dclone( \@_ ) };
    ...
  }

Storable is a standard module that is installed with Perl. For a list of all 
standard pragmatics and modules, see `perldoc perlmodlib`.



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to