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




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

Reply via email to