hexcoder has asked for the wisdom of the Perl Monks concerning the following question:
finally I had a task for the format/write functionality in Perl. While toying around with Perl 5.26.2, I could not find a way however to feed multiple field values into a repeated format line without getting warnings. Probably I am doing something wrong, but what?
Thanks for any insights!
givesuse strict; use warnings; use open ':locale'; sub print_data { my ($name, @f); format START = .===================. |@<<<<<<| | $name | | | .=======.===========. |@<<<<<<| @<</@>> |~~ splice( @f, 0, 3 ) .=======.===========. . binmode STDOUT, ':raw:crlf'; my $ofh = select(STDOUT); $~ = "START"; $name = 'TAB'; @f = ('Step2', 0, 4, 'Step3', 4, 4); write; } print_data;
perl -w .\TryFormat.pl Not enough format arguments at .\TryFormat.pl line 16. Not enough format arguments at .\TryFormat.pl line 16. Not enough format arguments at .\TryFormat.pl line 16. .===================. |TAB | | | | | .=======.===========. |Step2 | 0 / 4 | |Step3 | 4 / 4 | .=======.===========.
|
---|