--- "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,
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
"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
- 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
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;
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
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
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
>
- 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
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
> -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?.
>
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
__
12 matches
Mail list logo