Hi all

I got started on Perl only today!
I have a text file in which I need to read a line and the line after
that. Like

line1 and line2
line2 and line3
line3 and line4

when I use  while($line1 = <MYFILE>){
                           $line = <MYFILE>;
                 }

I get output
line1 and line2
line3 and line4 ..etc. I guess everytime I read a line, it increases
the counter and reads the next line. I tried playing with the $.
variable, but it did not help.

Any suggestions here will be very helpful

thanks
Ayesha


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to