my $f1; my $c = <>; # get number # Get factor and the new number to test while ($c > 1) { ($f1,$c) = get_a_factor($c); print ", $f1"; } print "\n"; sub get_a_factor { my $num = shift; ... compute factor ... return ($factor, $num/$factor); }