Connecting Tech Pros Worldwide Forums | Help | Site Map

can't get backreferences to work

everymn@yahoo.com
Guest
 
Posts: n/a
#1: Feb 20 '07
Could someone tell me what I'm doing wrong to cause the backreference
variable to fail to be assigned here? It's entering the If block 4
times, so I know it's matching but there's nothing in $1?

Thank You!


#! /usr/bin/perl
use warnings;
use strict;

open FH, 'results.xml' or die "this didn't work: $!";

$/ = "<test-case name=";

while (<FH>)
{
if (/rssupports/)
{
print "DEBUG: \n";
print "$1" if defined $1;
}
}

OUTPUT:
DEBUG:
DEBUG:
DEBUG:
DEBUG:

everymn@yahoo.com
Guest
 
Posts: n/a
#2: Feb 21 '07

re: can't get backreferences to work


figured it out, thanks
Closed Thread