Re: Read 20 lines when pressing n for next
- From: Jürgen Exner <jurgenex@xxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 01:48:05 GMT
s9uzaa@xxxxxxxxx wrote:
I would like to write a perl script with the following criteria match.
1. open any text file
perldoc -f open
taken the name from the command line.
perldoc perlvar and check for '@ARGV'
2. read top 20 lines and stops, then
perldoc perlsyn and check for 'for'. However given the next requirement
the algorithm becomes a lot easier if you slurp in the whole file into
an array. If you read 20 line chunks then you need to seek forward and
backward all the time which is a real pain. In an array you just move
your current index.
3. ask to press letter "n or p" (for next/previous)
perldoc -q single
to print next or previous 20 lines.
would appreciate any kind of help.
Maybe you should ask your tutor/teacher?
4. must have subroutine used.
perldoc perlsub
jue
.
- References:
- Read 20 lines when pressing n for next
- From: s9uzaa
- Read 20 lines when pressing n for next
- Prev by Date: Read 20 lines when pressing n for next
- Next by Date: Re: Read 20 lines when pressing n for next
- Previous by thread: Read 20 lines when pressing n for next
- Next by thread: Re: Read 20 lines when pressing n for next
- Index(es):
Relevant Pages
|