Re: Regex search using scalar

2003-11-06 Thread Sudarshan Raghavan
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

RE: Regex search using scalar

2003-11-06 Thread Paul Harwood
'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

RE: Regex search using scalar

2003-11-05 Thread Bob Showalter
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

RE: Regex search using scalar

2003-11-05 Thread Bob Showalter
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(

Re: Regex search using scalar

2003-11-05 Thread Tore Aursand
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 ) {