When you do the read, the pointer(best I can think of) is set at the next 
record. Unless you close the file and re-open the file, the next time you do a read it 
will start where you left off.  In a loop, which has the following setup:

        while ( <FILEIN> ) {

       }
        Within the loop, you may find a particular type of record or text which 
requires you to read say three more records.  You could do this by:

           chomp(my $MyRcd2 =<FILEIN>);
           chomp(my $MyRcd3 =<FILEIN>);
           chomp(my $MyRcd4 =<FILEIN>);

        You may put this in another loop with checks, but the next read would be at 
the fifth record.

Wags ;)
-----Original Message-- ---
From: Scott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 08, 2002 06:12
To: Wagner-David
Cc: [EMAIL PROTECTED]
Subject: RE: Stripping records


On Mon, 7 Jan 2002, Wagner-David wrote:
>       If straight text, then could just read the first line and start on the second:
>       my $MyHdrLine = <FILEIN>; # get first line
>       WHILE ( <FILEIN> ) {
>        }
>       You have bypassed first line(has carriage return still with it.
>       Now you start your processing.

It works, but I want to understand it as well.  So, it is taking the first 
line and storing it in $MyHdrLine, why then does perl start at the second 
line after that?



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to