can't get backreferences to work

E

everymn

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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top