in reply to Re: Output question
in thread Output question
I don't see why you should write your pager as '| more' will work both on unices and windoze...
But, If you want to do it anyway, a simple test in front of each print :
should be enough for simple/small scripts...
Or to be a little bit cleaner, using print2 instead of print, whith print2 defined like this :
UPDATE :
Term::ReadKey May be more appropriate than getc.
Anyway you got the idea...
UPDATE2 :
This answer is for oaklander, I replied to the wrong post. Apologizes (especially to Hotshot).
"Only Bad Coders Code Badly In Perl" (OBC2BIP)
But, If you want to do it anyway, a simple test in front of each print :
if(++$line > $LINEMAX) { $line=0; getc; }
should be enough for simple/small scripts...
Or to be a little bit cleaner, using print2 instead of print, whith print2 defined like this :
sub print2 { if(++$line > $LINEMAX) { $line=0; getc; } print @_; }
UPDATE :
Term::ReadKey May be more appropriate than getc.
Anyway you got the idea...
UPDATE2 :
This answer is for oaklander, I replied to the wrong post. Apologizes (especially to Hotshot).
"Only Bad Coders Code Badly In Perl" (OBC2BIP)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re (tilly) 3: Output question
by tilly (Archbishop) on Jan 04, 2002 at 09:32 UTC | |
Re: Output question
by oaklander (Acolyte) on Dec 26, 2001 at 19:10 UTC | |
by arhuman (Vicar) on Dec 26, 2001 at 19:42 UTC |
In Section
Seekers of Perl Wisdom