This code creates an array of consequtive numbers from 1 to 10000 and changes every number to a random value and restores the initial value. I wasn't able to reproduce your problem. I suppose the problem you are facing is located on the different code part as you showed.# 858508.pl use strict; use warnings; use 5.010; my @array_old = my @array = ( 1 .. 10e3 ); for my $i ( 0 .. $#array ) { my $buffer = $array[$i]; $array[$i] = new_value(); $array[$i] = $buffer; } if( @array_old ~~ @array ) { say "arrays are equal"; } else { say "array are different"; } sub new_value { rand(); }
In reply to Re^3: volatile memory?
by wwe
in thread volatile memory?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |