geofflh has asked for the wisdom of the Perl Monks concerning the following question:
In my Perl reference manual, it describes a method of generating a variable field for output as -
$w = 3; $str = "abc"; $line = sprint ("%${w}s ", $str);This works just fine unless there is a " use strict; " in force. Other than putting a "no strict; code line; strict;" wrapper around the construct, how can I generate a variable output field within a strict setting?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use of strict
by Athanasius (Archbishop) on Jul 25, 2017 at 07:40 UTC | |
|
Re: use of strict
by shmem (Chancellor) on Jul 25, 2017 at 07:28 UTC | |
|
Re: use of strict
by haukex (Archbishop) on Jul 25, 2017 at 07:41 UTC | |
|
Re: use of strict
by Corion (Patriarch) on Jul 25, 2017 at 07:31 UTC | |
by shmem (Chancellor) on Jul 25, 2017 at 07:48 UTC | |
by Corion (Patriarch) on Jul 25, 2017 at 07:54 UTC |