You don't need to set arrays to empty at declaration time - they start out that way.
Rather than using shift to pull off parameters one at a time in various scattered locations through your sub, use list assignment with a declaration of a list of variables at the top of the sub.
If you have a reasonable variable name adding a comment that simply reiterates the variable name in expanded form doesn't add any information.
Taking all that into account your code sample becomes:
my @isec; my @b; (@b, @isec) = ArrayFunctions(\@ArrayA, \@ArrayB, \@b, \@isec); sub ArrayFunctions { my ($a_ref, $b_ref, $b, $isec) = @_; my @a = @$a_ref; my @b = @$b_ref; my %Aseen = map {$_ => undef} @a; my %Bseen = map {$_ => undef} @b; #.......... Other Code ..... }
Oh, and misleading comments are worse than no comment. There was a mismatch between the names of the hashes in the sub and the comment so I removed the comment. If the comment was right and names are wrong, change the names (and still omit the comment).
In reply to Re: Syntax error for the following ???
by GrandFather
in thread Syntax error for the following ???
by mr_p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |