Using Formats and stopping between pages

C

Crixx

Hello,

I am writing a menu-line program. For presenting some data I use a
regular format and a Top-of-page format.

Inside a while loop I call the format. The paging is done fine it puts
the top-of-page heading fine, page number and so on, but the whole
result scrolls through the screen. I would like it to pause beteen
page and page, so that the user can read it.

Is there a way to do it?

Please help me I have been looking through all FAQ and newsgroups.

TIA and regards,
Cristina

Some of my code is:

format WEB_SERVICES =
@<: @<<<<<<<<<<<<<<<<< with URL: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$line_number, $web_data[6], $web_data[11]
Instance:mad:<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$web_data[0]
----------------------------------------------------------------------
..

while ($line = <CONFIG>) {
@web_data = split(/\|/,$line);
write;
$line_number ++;
}
 
S

Sam Holden

Hello,

I am writing a menu-line program. For presenting some data I use a
regular format and a Top-of-page format.

Inside a while loop I call the format. The paging is done fine it puts
the top-of-page heading fine, page number and so on, but the whole
result scrolls through the screen. I would like it to pause beteen
page and page, so that the user can read it.

Is there a way to do it?

Please help me I have been looking through all FAQ and newsgroups.

I've never used formats, so this is a bit of a stab in the dark without
really knowing how they work...

$- gives the number of lines left (according to perldoc perlvar).

So you should be able to use it and the number of lines that are going
to be output by write to know if the write if going to start a new page.
If it is you could do your own "press any key to continue" handling.

Alternatively, you could pipe the output through something like more,
I guess that might require making sure the format lines per page is the
same as the number of lines more thinks the terminal has...
 
R

Ron Reidy

There is a Pager module described in Object Oriented Perl by Damian
Conway that might do this for you.

--
Ron Reidy
Oracle DBA
Hello,

I am writing a menu-line program. For presenting some data I use a
regular format and a Top-of-page format.

Inside a while loop I call the format. The paging is done fine it puts
the top-of-page heading fine, page number and so on, but the whole
result scrolls through the screen. I would like it to pause beteen
page and page, so that the user can read it.

Is there a way to do it?

Please help me I have been looking through all FAQ and newsgroups.

TIA and regards,
Cristina

Some of my code is:

format WEB_SERVICES =
@<: @<<<<<<<<<<<<<<<<< with URL: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$line_number, $web_data[6], $web_data[11]
Instance:mad:<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$web_data[0]
----------------------------------------------------------------------
.

while ($line = <CONFIG>) {
@web_data = split(/\|/,$line);
write;
$line_number ++;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top