On Thu, Aug 02, 2001 at 12:51:55PM -0400, Ron Woodall wrote:
> Hi All:
> 
>       A bit of a conundrum here.
> 
>       while (attlist[$x] =~ m|<!-- start description| || m|<!-- start 
> explanation|) {x++}
> 
>       It finds "description" but not "explanation." What am I doing wrong?  It 
> works sometimes but not other times.

The =~ isn't transitive across multiple m// operations.

That is, you're doing a match against $attlist[$x] with the first m//,
but doing a match against $_ (the default variable used for matching)
on the second m//.

The answer is to be more explicit in what you are trying to do:
        while ($attlist[$x] =~ m/../ || $attlist[$x] =~ m/.../) {
        }

Also, using |...| as a match delimiter along side the boolean || operator
makes your test a little difficult to read.  Please consider using a 
different match delimiter (//, {}, (), etc.).

Z.


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

Reply via email to