Hello to everyone. In the last hour I've been trying to format the contents of a file using Perl formats, with no success. A brief example:
I example
Output:my $text = "line 1\0line 2\0line 3"; IO::Handle->format_line_break_characters("\0"); format STDOUT = Text: ^* $text ~~ ^* $text . write;
Text: line 1line 2line 3
II example
Output:my $text = "line 1\nline 2\nline 3"; IO::Handle->format_line_break_characters("\0"); format STDOUT = Text: ^* $text ~~ ^* $text . write;
Text: line 1 line 2 line 3
III example
Output:my $text = "line 1\nline 2\nline 3"; ####IO::Handle->format_line_break_characters("\0"); format STDOUT = Text: ^* $text ~~ ^* $text . write;
Text: line 1 line 2 line 3
Taken straight from the perlform man page "The Field ^* for Variable-Width One-line-at-a-time Text" paragraph.
According to the "Using Fill Mode" paragraph, unless I've misunderstood the context, changing the $FORMAT_LINE_BREAK_CHARACTERS or $: variable should change the characters used for line-breaking.
In the first two examples above the variable is correctly set to "\0", instead of its default value " \n-", but that doesn't appear to make lines in the output break on anything other than "\n".
Any ideas? Any obvious misunderstandings on my part?
In reply to Perl format line breaking, $FORMAT_LINE_BREAK_CHARACTERS apparently ignored by trantorvega
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |