RE: How to read a single line from file

2001-06-04 Thread Jenda Krynicky
From: [EMAIL PROTECTED] open (IN, a.txt) ; while (IN) { chomp ($line = ); # $line contains line from a.txt No $line contains a line from a file whose name is in @ARGV or from STDIN. You wanted $line = IN !!! Jenda == [EMAIL PROTECTED]

Re: How to read a single line from file

2001-06-04 Thread Rodney Wines
From: [EMAIL PROTECTED] open (IN, a.txt) ; while (IN) { chomp ($line = ); # $line contains line from a.txt No $line contains a line from a file whose name is in @ARGV or from STDIN. You wanted $line = IN !!! No ... :-) The while(IN) reads a line into $_. So, just chomp;

RE: How to read a single line from file

2001-06-04 Thread Shawn
I think Jenda's original post of $line = IN was meant to be like this: open (IN, a.txt) ; while ($line = IN) { # $line contains line from a.txt } Why not just do chomp; ? Since we are using $_, it will work on it without any var... open (IN, a.txt) ; while (IN) { chomp; # $line

Re: How to read a single line from file

2001-06-04 Thread Jenda Krynicky
From: Rodney Wines [EMAIL PROTECTED] From: [EMAIL PROTECTED] open (IN, a.txt) ; while (IN) { chomp ($line = ); # $line contains line from a.txt No $line contains a line from a file whose name is in @ARGV or from STDIN. You wanted $line = IN !!! No

How to read a single line from file

2001-06-04 Thread Saxena, Saurabh
I am using a while loop to read a file like open (IN, a.txt ) ) while(IN) { --- --- } This will read the entire file reading line by line.Now the problem is that inside the while loop at some particular place i want to read just one line(next line) without going back to main loop.I am trying

RE: How to read a single line from file

2001-06-04 Thread James . Herbert
open (IN, a.txt) ; while (IN) { chomp ($line = ); # $line contains line from a.txt } -Original Message- From: saurabh.saxena Sent: 04 June 2001 09:44 To: perl-win32-users; activeperl Cc: saurabh.saxena Subject: How to read a single line

RE: How to read a single line from file

2001-06-04 Thread Petr Smejkal
file). @lines = IN; -- Petr Smejkal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Saxena, Saurabh Sent: Monday, June 04, 2001 10:44 AM To: 'Perl1'; 'Perl2' Subject: How to read a single line from file I am using a while loop to read a file like

Re: How to read a single line from file

2001-06-04 Thread M.W. Koskamp
- Original Message - From: Shawn [EMAIL PROTECTED] To: Saxena, Saurabh [EMAIL PROTECTED] Cc: 'Perl1' [EMAIL PROTECTED]; 'Perl2' [EMAIL PROTECTED] Sent: Monday, June 04, 2001 11:20 AM Subject: RE: How to read a single line from file Ok, try this: open (IN, a.txt); my $found_x

RE: How to read a single line from file

2001-06-04 Thread Shawn
Yes, grep has some great benefits if used properly! Unfortunately a lot of people, myself included up until a couple of months ago, either don't know about or how to use it. I didn't figure I would throw it out there since there was already some confusion :-) Shawn Or in a shorter way: