RE: Question!! number of line....

2002-01-11 Thread Curtis Poe
--- "WANG, SHIPING [AG/1000]" <[EMAIL PROTECTED]> wrote: > Hi, Question for your code: > > what is the meaning "require 5;" Require with just a version number means that you must be running Perl 5 or better. For example, let's say I was to use the 'our' keyword. That was introduced in 5.6,

RE: Question!! number of line....

2002-01-11 Thread WANG, SHIPING [AG/1000]
Hi, Question for your code: what is the meaning "require 5;" -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, December 28, 2001 3:54 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Question!! number of line requi

Re: use strict, How to 'globalised' variable within loops. (was => Re: Question!! number of line....)

2001-12-29 Thread Michael R. Wolf
"Leon" <[EMAIL PROTECTED]> writes: [...] > (1)how to make a variable within loops non-lexical as in this eg:- > while (){ > my $count++; # how to globalised this variable? $count++; # NO "my", therefore implicitly global. > }; > > (2)how to make a variable availab

use strict, How to 'globalised' variable within loops. (was => Re: Question!! number of line....)

2001-12-29 Thread Leon
- Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> > Leon wrote: > > > > - Original Message - > > From: "Mark Mclogan" <[EMAIL PROTECTED]> > > > How I can know in that I number of line finds a word in a text file?. > > > For example, a file "file.txt" contains the foll

Re: Question!! number of line....

2001-12-29 Thread Simon K. Chan
Hiya Mark, Something like this should work: #!/usr/local/bin/perl -w use strict; my $file = "file.txt"; open (READ, "<$file") || die "Can\'t open file: $!"; my @list_of_words = ; close (READ) || die "Can\'t close file: $!"; my $counter = 1; foreach my $word (@list_of_words){ ++$counter;

Re: Question!! number of line....

2001-12-29 Thread Connie Chan
t $lineNumber[0]; have a nice day =) - Original Message - From: "Mark Mclogan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, December 29, 2001 5:36 AM Subject: Question!! number of line > > How I can know in that I number of line finds a

Re: Question!! number of line....

2001-12-29 Thread Connie Chan
open (FILE, ") { if ($_ eq "apple\n") { $count++ } } close (FILE); you got the result at $count have a nice day =) - Original Message - From: "Mark Mclogan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, December 29, 2001 5:36

Re: Question!! number of line....

2001-12-29 Thread John W. Krahn
Leon wrote: > > - Original Message - > From: "Mark Mclogan" <[EMAIL PROTECTED]> > > How I can know in that I number of line finds a word in a text file?. > > For example, a file "file.txt" contains the following list: > > > > Chocolate > > Cake > > Cheese > > Apple > > orange > > melon >

Re: Question!! number of line....

2001-12-28 Thread Leon
- Original Message - From: "Mark Mclogan" <[EMAIL PROTECTED]> > How I can know in that I number of line finds a word in a text file?. > For example, a file "file.txt" contains the following list: > > Chocolate > Cake > Cheese > Apple > orange > melon > lemon > > How I can know in that l

RE: Question!! number of line....

2001-12-28 Thread SathishDuraisamy
k Mclogan [mailto:[EMAIL PROTECTED]] Sent: Friday, December 28, 2001 1:37 PM To: [EMAIL PROTECTED] Subject: Question!! number of line How I can know in that I number of line finds a word in a text file?. For example, a file "file.txt" contains the following list: Chocolate Cake

RE: Question!! number of line....

2001-12-28 Thread Bob Showalter
> -Original Message- > From: Mark Mclogan [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 28, 2001 4:37 PM > To: [EMAIL PROTECTED] > Subject: Question!! number of line > > > > How I can know in that I number of line finds a word in a text file?. >

Question!! number of line....

2001-12-28 Thread Mark Mclogan
How I can know in that I number of line finds a word in a text file?. For example, a file "file.txt" contains the following list: Chocolate Cake Cheese Apple orange melon lemon How I can know in that line number is the Apple word? Over MMClogan __