processAorB ....{ my @commonArray; commonStuff( \@commonArray, \%other, \$variables ); ... } sub commonStuff { my ( $commonArrayRef, $hash, $var ) = @_; if ( $commonArrayRef->[0] > 37 ) { ... } } #### sub processA { ... commonInit() commonStuff( $various, $vars ); } sub processB { ... commonInit() commonStuff( $various, $other, $vars ); } { my @commonArray; sub commonInit { @commonArray = (); } sub commonStuff { # do stuff to @commonArray; } }