Have you tried setting $- (number of lines left on the current page) to a suitably large number after each write instead?
Update
Since there seems to be some question as to whether my suggestion would work, I did the following test:
use strict;
use warnings;
$= = 5;
for(1..15) {
write;
#$- = 999;
}
format STDOUT =
@### @###### @###
$_, $_**2, $-
.
format STDOUT_TOP =
---TOP---
.
__END__
If I run the above, I get the following at the console:
---TOP---
1 1 0
2 4 3
3 9 2
4 16 1
♀---TOP---
5 25 0
6 36 3
7 49 2
8 64 1
♀---TOP---
9 81 0
10 100 3
11 121 2
12 144 1
♀---TOP---
13 169 0
14 196 3
15 225 2
and if I uncomment the line setting $- to 999, I get:
---TOP---
1 1 0
2 4 999
3 9 999
4 16 999
5 25 999
6 36 999
7 49 999
8 64 999
9 81 999
10 100 999
11 121 999
12 144 999
13 169 999
14 196 999
15 225 999
So I believe resetting $- should work. It is also noted in perlfunc under write that setting $- to zero will force a page break, which follows the same pattern.
--
I'd like to be able to assign to an luser
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|