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

Re: Reading lines from a file

2002-04-03 Thread John W. Krahn
Mark Anderson wrote: > > #open FILE or die... > my $location = ; > my $format = ; > my $cost = ; > my $start = ; > my $runby = ; > my $prize = ; > > now you have each of the 6 lines in its own variable. You can then use the > variables to lay out your HTML. And of course you can put it all on

RE: Reading lines from a file

2002-04-03 Thread Mark Anderson
: Wednesday, April 03, 2002 1:26 PM To: [EMAIL PROTECTED] Subject: RE: Reading lines from a file I have a six line file with base data in. I am trying to use that data to create HTML code. Data looks like LOCATION FORMAT COST START TIME RUN BY PRIZE When I create the HTML some of these will be

RE: Reading lines from a file

2002-04-03 Thread Glenn Cannon
into the correct part of the HTML. -Original Message- From: Mark Anderson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 4:22 PM To: Glenn Cannon; [EMAIL PROTECTED] Subject: RE: Reading lines from a file Specific by line number? specific by text in the line? specific as line

RE: Reading lines from a file

2002-04-03 Thread Mark Anderson
-Original Message- From: Glenn Cannon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 12:47 PM To: [EMAIL PROTECTED] Subject: Reading lines from a file How do I read a specific line from a text file? I know how to open and close the file, and how to read the entire file, is there a

Reading lines from a file

2002-04-03 Thread Glenn Cannon
How do I read a specific line from a text file? I know how to open and close the file, and how to read the entire file, is there a way (maybe by setting $.) to read a specific line of the file?