... because after 11 count one character is incrementing so not printing aligned format ...
See sprintf.
Output:perl -Mstrict -Mwarnings -E ' my @x = qw/ 123 1234567890 12345678901 /; say sprintf("%-11s length %s", $_, length $_) for @x; '
123 length 3 1234567890 length 10 12345678901 length 11
Hope this helps!
In reply to Re^3: Count and print in perl
by 1nickt
in thread Count and print in perl
by kanikas16
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |