- or download this
###############################
# STRING CONCAT FUNCTION #
# BY DR JONATHAN REES #
###############################
- or download this
$l = 5; # $l defines the number of asterisks
- or download this
&concat($l); # calls the sub concat passing the
# number of concatenations in $l
- or download this
print $i; # prints the result
- or download this
sub concat {
...
}
- or download this
my $val = $_[0] + 1;
for ($k = 1 ; $k < $val ; $k++){ $i = $i.$sym; }
- or download this
my $i = '';
for (1 .. $_[0]) { $i = $i . $sym }
- or download this
# Concatenate a number of symbols.
...
for (1 .. $_[1]) { $i = $i . $_[0] }
return $i;
}