(My termemology may be off here, I'm a hardware guy :))
I see, You can send the pointer to the array to the subroutine so that the subroutine knows which array to modify. This works for me !!
Also, my appologies for caling it @var1. It actually highlights my 'wrong' thinking that you can treat an array just like a variable. (and this may be what you were saying, i.e. pointing out my 'wrong' thinking.) This code was actually a stripped down example (believe it or not) and as I replaced the original variables and arrays, I just picked @var1 and $var2.
Thanks for your help, I understand now.
Also, for my purpouses, This works just as well: (Note, I global replaced 'var1' with 'fee')
my @some_arry_to_modify_by_the_sub;
my @some_other_arry_to_modify_by_the_sub_with_the_same_structure_but_
+different_data;
#some call like ---> change_fee_1(@some_arry_to_modify_by_the_sub);
#or ---> change_fee_2(@some_arry_to_modify_by_the_sub)
sub change_fee_1 {
change_fee_2(@_);
$status = "change_fee_1 called $_[3], $_[5]";
}
sub change_fee_2 {
$_[3] = 6;
$status = "change_fee_2 called $_[3]";
}
| [reply] [d/l] |