The variable you are looking for is:
$= = undef; # default is 60 lines per page.
## or
use English;
$FORMAT_LINES_PER_PAGE = undef;
## or
format_lines_per_page HANDLE undef;
--
$you = new YOU;
honk() if $you->love(perl) | [reply] [d/l] |
Hi,
Can you please say where to use the $= = undef; ?
| [reply] |
Before you apply/print/output the formatting, see $=
| [reply] |
The special variable $^L (or, in English, $FORMAT_FORMFEED) seems to have something to do with this. I can't find it in the Camel, but perlvar leads me to believe that's what you want.
By default, it's \f (formfeed), but you might set it to a blank string or undefined and see what happens. (I haven't tried this, as formats are one of the things I've never used in Perl. The shame!)
Update: It's on the middle of page 663 in Camel 3. | [reply] |
| [reply] |
FWIW, in Camel v2 it's page 133 (Formats starts on p121,
it happens that I was looking at this stuff the other day). I rarely
use formats but the more I read the more I think avoiding
formats is a bit like avoiding modules ;-).
| [reply] |
you can set the number of lines by setting $=, the default is 60 lines,
if you wanted it to print a header after say 300 lines, you just just throw a
$= = 300;
before your write statement. | [reply] [d/l] |
Thanks for the tips.
I got it to work with:
use English;
use FileHandle;
format_lines_per_page HANDLE 300;
If you use undef instead of 300 it will print the FORMAT_TOP
after each line of output.
| [reply] [d/l] |