Re: Read 20 lines when pressing n for next



Chris Mattern <syscjm@xxxxxxxxxxxxxx> wrote in
news:slrng1h584.r80.syscjm@xxxxxxxxxxxxxx:

On 2008-04-30, A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx> wrote:
s9uzaa@xxxxxxxxx wrote in news:37b9eb38-e188-4dc2-b3a7-
5f09cc3b81ea@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

I would like to write a perl script with the following criteria
match.

Give it a shot. Then post any questions you might encounter (please
read the posting guidelines first).

1. open any text file taken the name from the command line.
2. read top 20 lines and stops, then
3. ask to press letter "n or p" (for next/previous) to print next or
previous 20 lines.
would appreciate any kind of help.
4. must have subroutine used.

Look up $. in perldoc perlvar

I got $5 that says this is homework. "must have subroutine used" is
a dead giveaway.

Agreed. Which is why he does not get any fish before showing his
attempts at fishing for himself ;-)

Sinan

--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
.



Relevant Pages

  • Re: Read 20 lines when pressing n for next
    ... Give it a shot. ... Then post any questions you might encounter (please read ... the posting guidelines first). ... read top 20 lines and stops, ...
    (comp.lang.perl.misc)
  • Re: Read 20 lines when pressing n for next
    ... Give it a shot. ... Then post any questions you might encounter ... read the posting guidelines first). ... as well be a simplified work project? ...
    (comp.lang.perl.misc)
  • Re: Read 20 lines when pressing n for next
    ... Give it a shot. ... Then post any questions you might encounter (please read ... the posting guidelines first). ... read top 20 lines and stops, ...
    (comp.lang.perl.misc)
  • Re: regex to convert 1000000 -> 1,000,000 ?
    ... Wally Sanford wrote: ... > Chris Mattern wrote: ... >> Well, if you come to this group, the posting guidelines, posted ... This reminds me of a suggestion I have posted a couple of times. ...
    (comp.lang.perl.misc)