So on a program I am currently writing I hacked together this teensy tiny little sub, which does the trick quite nicely. I suppose if somebody asks for it, I will hack in a more less-like 'readchar' functionality. it hardly seems necessary for what it does.
note: it requires a use vars qw() or other (such as our) form of global variable.
invocation:sub page { foreach (@_) { print "$_"; $ln++; if ($ln+1 == $=) { print "--more--"; chop (my $i=<>); $ln = 0 } } }
{ page "foo bar baz bletch"; page @an_array_of_text; page $foo; # or if you must... my $buf = sprintf ("%.5d", $real); page $buf; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Minuscule Pager Sub.
by petral (Curate) on Mar 20, 2001 at 00:02 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |