Or you could always do it this way:
my $n = 5; print "-" x $n; [download]
In reply to Re: Answer: How can i print N repeated characters? by ptum in thread How can i print N repeated characters? by Doraemon