Loading ...
Sorry, an error occurred while loading the content.

Regex

Expand Messages
  • kapil v
    Hi, #!/usr/bin/perl -w my $path = shift; my $machine = shift; my (undef,$country,$property) = split / //,$path; my $xmlData = qx!./pindown.php $machine!; my
    Message 1 of 10 , Sep 6 9:57 AM
    • 0 Attachment
      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\">.+?<contact type=\"admin\">.+?<\/contact>/is;
      #print "$&\n";
      print @contacts;

      This prints "1"
      But printing $& prints a block of XML.
      Why does the array contacts not contain the pattern matched?

      Thanks,
      Kapil.V

      ---------------------------------
      Yahoo! Answers - Get better answers from someone who knows. Tryit now.

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.