R
Roger
Greetings,
I *thought* I knew how to use 'scalar' and 'splice'...
while( $num < scalar(@odd_num) )
splice (@list,$odd_num[$num],0,$field_num[$num]);
#'odd_num' and 'field_num' are arrays loaded with integer index values, use here
in #a scalar context, the problem is after each call to splice, the array 'list'
#does not grow ... next line of code....
$num++;
my $range = scalar @list; #stuck in here for debugging
#Here the value of 'range' never changes from the entry into the while loop.
#yet in the debugger, I see @list growing with each iteration!!!!!
#It's making crazy!
Question, why isn't the call to 'scalar' reflecting the new size of '@list' with
each iteration?
I *thought* I knew how to use 'scalar' and 'splice'...
while( $num < scalar(@odd_num) )
splice (@list,$odd_num[$num],0,$field_num[$num]);
#'odd_num' and 'field_num' are arrays loaded with integer index values, use here
in #a scalar context, the problem is after each call to splice, the array 'list'
#does not grow ... next line of code....
$num++;
my $range = scalar @list; #stuck in here for debugging
#Here the value of 'range' never changes from the entry into the while loop.
#yet in the debugger, I see @list growing with each iteration!!!!!
#It's making crazy!
Question, why isn't the call to 'scalar' reflecting the new size of '@list' with
each iteration?