# calculate length and width of paper strip # based on diameter of circle of inner edge sub NumberCrunch() { my ($diameter) = @_; my $L = $diameter * 0.58778525229; my $W = $L * 0.951056516; # W = L * cos(18) my $total_length = $L * 47.725424859; return ($total_length, $W); } ... my ($TotalLength, $PaperWidth) = NumberCrunch($Diameter);