sub my_sub($) { ... do something EASY and fast ... return \$foo } foreach my $i (0 .. $a_bazillion) { $return_value = ${my_sub($some_value); }