postfix for loop in perl is not working as expected
The following line works perfectly
for(my $i=0; $i < ($max_size - $curr_size) ; $i++){
push (@{$_}, 0);
}
But this one doesn't.
push (@{$_}, 0) for (1 .. ($max_size - $curr_size));
It gives me an error message like this:
Can't use string ("1") as an ARRAY ref while "strict refs" in use at
coordReadEasy.pl line 124, <DATA> line 16.
Why? how can I solve this?
No comments:
Post a Comment