use strict; use warnings; my $w = 7; my $str = "abc"; printf ">%*s<\n", $w, $str; #### 17:34 >perl 1790_SoPW.pl > abc< 17:34 >