westrock2000 has asked for the wisdom of the Perl Monks concerning the following question:
I would like to use printf, but would also like to print a character multiple times. I cannot figure out the syntax
I have figured out you can do something like
But I what I would like to be able to do is something like AABBBCCCC
Normal print would just be as follows, but the commas throw me for a loop when it comes to printf.
I have figured out you can do something like
Which will print ABCprintf ("%c" x 3,65,66,67);
But I what I would like to be able to do is something like AABBBCCCC
Normal print would just be as follows, but the commas throw me for a loop when it comes to printf.
Thanks$a = chr(65); $b = chr(66); $c = chr(67); print ($a x 2, $b x 3, $c x 4);
Back to
Seekers of Perl Wisdom