On 16/10/2011 23:18, Rob Dixon wrote:
On 16/10/2011 19:10, JPH wrote:
Every pass I only change a single character, then I run some tests and
so on.
I wonder if it is possible to write your subroutine by using a single
global array and remembering the change so that you can undo it before
the code exits?
my @data = (...);
sub try {
my $old = $data[0][1];
$data[0][1] = '7';
...
$data[0][1] = $old;
return 3;
}
Only remembering a single scalar will be many times more efficient than
remembering the entire 256 scalars in the array.
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/