Rob Dixon wrote:

> Paul Johnson wrote:
>> Rob Dixon said:
>>
>> >     $data =~ m/ <([^>]*)> /x;
>> >     my $newdata = $1;
>>
>> And if the match fails?
> 
> Well I think it's likely that you'd want to do:
> 
>     $data =~ m/ <([^>]*)> /x or die "Malformed data";
> 
> or at least:
> 
>     $data =~ m/ <([^>]*)> /x or next;
> 
> as a mismatch inmplies that something's happening that
> you don't expect. But you're quite right, I should have
> pointed out that $1 etc. are 'sticky' and will keep their
> values from the last successful match. I'll go for:
> 
>     {
>         my $newdata;
>         $newdata = $1 if $data =~ m/ <([^>]*)> /x;
>         :
>     }
> 
> Rob

you want to know what's failing, right? 

unless ($data =~ m/ <([^>]*)> /x) {
    warn "## Error matching regex in '$data'";
    next;
}
$newdata = $1;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to