my ($f1, $f2, $f3, $f4, $f5); my $c = <>; # get number ($f1,$c) = get_a_factor($c); print "$f1, "; ($f2,$c) = get_a_factor($c); print "$f2, "; ($f3,$c) = get_a_factor($c); print "$f3, "; ($f4,$c) = get_a_factor($c); print "$f4, "; ($f5,$c) = get_a_factor($c); print "$f5\n"; sub get_a_factor { my $num = shift; ... compute factor ... return ($factor, $num/$factor); }