Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Jeff Pang
--- Ryan <[EMAIL PROTECTED]> wrote: > What is a lexical file handle? I'm working my way > through Ford's "Perl > Programming for the Absolute Beginner" (2007) and > Lee's "Beginning Perl" > (2004), and they both use the FH style of file > handle. >From perl 5.6 you can say, open my $fh,"te

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Chas Owens
On 7/19/07, Ryan <[EMAIL PROTECTED]> wrote: What is a lexical file handle? I'm working my way through Ford's "Perl Programming for the Absolute Beginner" (2007) and Lee's "Beginning Perl" (2004), and they both use the FH style of file handle. Should I do differently? snip Yes, you should use

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Ryan
What is a lexical file handle? I'm working my way through Ford's "Perl Programming for the Absolute Beginner" (2007) and Lee's "Beginning Perl" (2004), and they both use the FH style of file handle. Should I do differently? Thanks. --Chris Chas Owens wrote: On 7/19/07, [EMAIL PROTECTED] <

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Chas Owens
On 7/19/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Chas Owens wrote: > On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote: >> > >> > when I use while($line1 = ){ >> >$line = ; >> > } >> >

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread John W. Krahn
Chas Owens wrote: On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote: > > when I use while($line1 = ){ >$line = ; > } while ($line=) { print"$line"; } 2. while ($line =

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Chas Owens
On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote: > 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

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread [EMAIL PROTECTED]
On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote: > 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 = ){ >

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Rob Dixon
Chas Owens wrote: On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: Hrm, I am confused then:) I have this as a file I am using right now! while () { my @data = split; next unless @data == 3; next if grep (/[^0-9.-]/, @data); printf FILEOUT "X%s Y%s\n", $dat

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Chas Owens
On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: Hrm, I am confused then:) I have this as a file I am using right now! while () { my @data = split; next unless @data == 3; next if grep (/[^0-9.-]/, @data); printf FILEOUT "X%s Y%s\n", $data[0], $data[1];

RE: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Joseph L. Casale
uple of coordinates and processes them perfectly? I also am just learning, so I am not sure why I need to do more? Thanks! jlc -Original Message- From: Gary Stainburn [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 18, 2007 10:15 AM To: beginners@perl.org Subject: Re: Extreme beginner

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Gary Stainburn
On Wednesday 18 July 2007 17:08, Joseph L. Casale wrote: > Is that true? > I use while loops and they cycle through each line without me keeping > track? jlc Yeah, it's true. Why would you want to keep track? (you can BTW, look at perldoc perlvar for $.) in my code, the 1st line is written into $

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Jeff Pang
--- Ayesha <[EMAIL PROTECTED]> wrote: > 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 = ){ >$lin

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Gary Stainburn
On Wednesday 18 July 2007 06:16, Ayesha wrote: > 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 = ){ >$l

Extreme beginner question on reading lines from a file.

2007-07-18 Thread Ayesha
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 = ){ $line = ; } I get output line1 and line2 line3 and l