Repetition; print 10 stars : Repetition « String « Perl






Repetition; print 10 stars

   

#!/usr/bin/perl

$line="*";


$line x= 10;       # Repetition; print 10 stars
print "$line\n";

printf "\$var is %.2f\n", $var=4.2 + 4.69;

   
    
    
  








Related examples in the same category

1.Repetition operator, marked with an x.
2.brackets and Repetition operator
3.Use Repetition operator in conjunction with concatenation.
4.String multiply operator
5.If you want to draw a horizontal line made up of hyphens:
6.x times pattern : Repeat a string x times
7.Mix string multiplication operator and number multiplication