mrider has asked for the wisdom of the Perl Monks concerning the following question:
First off, I know that formats are not the preferred method for formatting text. What can I say, mea culpa.
However, I recently ran into a situation where the easiest way to go from problem to solution, on a one-use-script, was to use a format. However, I ran into the problem that I had to comment out "use strict" in order to get my code to compile. At least I had this problem if I used a format name other than "STDOUT"...
Is there something I am missing? Consider the following trivial code. Is there some way to use both the format and to get "use strict" to work?
#!/usr/bin/perl -w use strict; my $text1 = "A"; my $text2 = "B"; $~ = COLUMNS; write; exit; format COLUMNS = @<<<<<<@>>>>>>> $text1,$text2 .
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: "use strict" and formats
by Joost (Canon) on Mar 24, 2005 at 21:39 UTC | |
by mrider (Beadle) on Mar 24, 2005 at 22:00 UTC | |
by ww (Archbishop) on Mar 25, 2005 at 17:30 UTC |
Back to
Seekers of Perl Wisdom