You need to determine the size of the smaller array and restrict the loop accordingly.
my $size = @data1 < @data2 ? @data1 : @data2;
In reply to Re^5: Perl delete function
by hdb
in thread Perl delete function
by annel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |