J
John Black
Hopefully a simple question...
Given this printf that specifies some fixed length left justified columns:
printf "%-30s, %-30s, %-30s\n", $a, $b, $c;
How can I make the hardcoded number 30 use a variable, say $len instead?
This does not work:
printf "%-$lens, %-$lens, %-lens\n", $a, $b, $c;
I'm guessing because perl would have trouble knowing that the s at the end is not part of the
variable? Thanks.
John Black
Given this printf that specifies some fixed length left justified columns:
printf "%-30s, %-30s, %-30s\n", $a, $b, $c;
How can I make the hardcoded number 30 use a variable, say $len instead?
This does not work:
printf "%-$lens, %-$lens, %-lens\n", $a, $b, $c;
I'm guessing because perl would have trouble knowing that the s at the end is not part of the
variable? Thanks.
John Black