use strict; package ComplexCalculation; sub do_calc { # put your calculation here. return 4 + 8 * 15 / 16 - 23 * 42; } 1; #### $variable1 = ComplexCalculation::do_calc(); #### use ComplexCalculation; #### use lib '/some/path/to/the/calc/module'; #### sub do_calc { my $v1 = ##... something my $v2 = ##... other thing my $v3 = ##... a third thing return $v1, $v2, $v3 } #### my ($r1, $r2, $r3) = ComplexCalculation::do_calc() #### my ($weight, undef, $depth) = ComplexCalculation::do_calc()