Re: Help with data returned by regex match

2007-09-12 Thread Chas Owens
On 9/12/07, Andrew Curry <[EMAIL PROTECTED]> wrote: > providing you match works you need () around the pattern > > i.e. > > @matches = ( $string =~ m/ expression /xgsi ); > otherwise it just returns the scalar result it believe i.e. the number of > matches snip You don't need the parens around the

Re: Help with data returned by regex match

2007-09-12 Thread Chas Owens
On 9/12/07, kapil v <[EMAIL PROTECTED]> wrote: > The input is an xml file. It contains nodes like > > > > > > > [EMAIL PROTECTED] > > > > I want to find the contact e-mail for a given property. > I did a workaround by using $& to get the pattern matched, and processed it > to get the e-mai

Re: Help with data returned by regex match

2007-09-12 Thread kapil v
The input is an xml file. It contains nodes like [EMAIL PROTECTED] I want to find the contact e-mail for a given property. I did a workaround by using $& to get the pattern matched, and processed it to get the e-mail, but it is confusing why the matched pattern is not captured by the assig

RE: Help with data returned by regex match

2007-09-12 Thread Andrew Curry
; beginners@perl.org Subject: Re: Help with data returned by regex match The input is an xml file. It contains nodes like [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> I want to find the contact e-mail for a given property. I did a workaround by using $& to get the pattern ma

Re: Help with data returned by regex match

2007-09-11 Thread Chas Owens
On 9/11/07, kapil.V <[EMAIL PROTECTED]> wrote: > Hi, > > #!/usr/bin/perl -w > my $path = shift; > my $machine = shift; > my (undef,$country, $property) = split /\//,$path; > my $xmlData = qx!./pindown. php $machine!; > my @contacts = $xmlData =~ /property name=\"$property\ " > country=\"$country\ "

Re: Help with data returned by regex match

2007-09-11 Thread Beginner
On 11 Sep 2007 at 11:36, kapil.V wrote: > Hi, > > #!/usr/bin/perl -w > my $path = shift; > my $machine = shift; > my (undef,$country, $property) = split /\//,$path; > my $xmlData = qx!./pindown. php $machine!; > my @contacts = $xmlData =~ /property name=\"$property\ " > country=\"$country\ ">.+?

RE: Help with data returned by regex match

2007-09-11 Thread Andrew Curry
What exactly are you trying to do and what values are you using for your test? -Original Message- From: kapil.V [mailto:[EMAIL PROTECTED] Sent: 11 September 2007 07:06 To: beginners@perl.org Subject: Help with data returned by regex match Hi, #!/usr/bin/perl -w my $path = shift; my $mach