#!/bin/perl print "The numbers are " ; print &HyphenatedList(3) ; print "\n" ; sub HyphenatedList { my ($stopat) = @_ ; # read in the parameter list my $line = "0" ; $n = 1 ; while ($n <= $stopat) { $line = $n++ . "-" . $line ; # perl will convert $n to strings automatically } return $line ; }