#!/bin/perl ############################### # STRING CONCAT FUNCTION # # BY DR JONATHAN REES # ############################### $l = 5; # $l defines the number of asterisks $sym = "*"; # $sym is the string to be concatenated &concat($l); # calls the sub concat passing the # number of concatenations in $l print $i; # prints the result sub concat { my $val = $_[0] + 1; for ($k = 1 ; $k < $val ; $k++){ $i = $i.$sym; } }