my $variable = my_subroutine(\$array_start_idx, \$array_end_idx); sub my_subroutine { my $start_idx = shift; my $end_idx = shift; # involves accessong the global array using the indices passed ... return(\$variable); }