Go Back   Velocity Reviews > Newsgroups > PERL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

PERL - can't get backreferences to work

 
Thread Tools Search this Thread
Old 02-20-2007, 11:17 PM   #1
Default can't get backreferences to work


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
  Reply With Quote
Old 02-21-2007, 12:25 AM   #2
everymn@yahoo.com
 
Posts: n/a
Default Re: can't get backreferences to work

figured it out, thanks
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump