in reply to use of strict
Hello geofflh, and welcome to the Monastery!
Here’s another syntax variation you may find useful: including * in the format string of a call to printf (or sprintf):
use strict; use warnings; my $w = 7; my $str = "abc"; printf ">%*s<\n", $w, $str;
Output:
17:34 >perl 1790_SoPW.pl > abc< 17:34 >
— the * is replaced by the contents of the next variable in the following list, in this case $w, so the statement is equivalent to printf ">%7s<\n, $str.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|