Paul Harwood wrote:
The search patterns I am looking for are contained inside the list (each
element of the list is going to be used to scan an entire log file). So
"if ( /match/ )" needs to reference each element of the FOREACH loop
which I will have nested inside a while loop. That's what's
con
's
confusing me.
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Tore Aursand
Posted At: Wednesday, November 05, 2003 5:12 AM
Posted To: Perl
Conversation: Regex search using scalar
Subject: Re: Regex search using scalar
On Tue, 04 Nov 2003 20:41:17 -0800, Paul Harwood wrot
rwood; Beginner Perl
> Subject: RE: Regex search using scalar
>
> Paul Harwood wrote:
> > I would like to enumerate a list and search through each element
> > like so:
> >
> >
> >
> > If (/$logs[i]/)
> >
> >
> >
> > { # code
Paul Harwood wrote:
> I would like to enumerate a list and search through each element like
> so:
>
>
>
> If (/$logs[i]/)
>
>
>
> { # code}
>
>
>
>
>
> I know the syntax is wrong so I was hoping someone could
> explain how to
> do this.
If I understand correctly, you want to use grep(
On Tue, 04 Nov 2003 20:41:17 -0800, Paul Harwood wrote:
> I would like to enumerate a list and search through each element like
> so:
> [...]
Why do you want to enumerate the list? Do you _really_ need to know the
index of the current element? If really so:
my $i = 0;
foreach ( @list ) {