On Fri, May 04, 2001 at 12:29:30AM -0500, Ken Williams wrote:
> [EMAIL PROTECTED] (will trillich) wrote:
> > >    sub search {
> > >        # ....
> > >        {
> > >            use CGI qw/:standard/;
> > >            my     $form = join '',
> > >                map {
> > >                    hidden(
> > >                        -name => $_,
> > >                        -value => $arg->{$_},
> > >                        ) . "\n"
> > >                }
> > >                grep(
> > >                    $arg->{$_} and ($_ ne 'd') and ($_ ne 'go')
> >
> >as is, the functions that follow (top-level 'sub xyz {}') get
> >screwy. code disappears.
> >
> >replace "and" with "&&" and all is well. boggles my mind.
> 
> 
> Well, as far as I can tell, the original code doesn't even compile
> because there aren't enough arguments to grep().  That's why I couldn't
> test it.  

        grep(
                $arg->{$_} and ($_ ne 'd') and ($_ ne 'go')
        , keys %$arg # note the leading comma...
        )

aha -- so maybe "x and y and z , pdq" has lexical precedence
where the (z,pdq) parses higher, as in

        x and y and (z , pdq)

versus what i expected, which was

        (x and y and z) , pdq

hmm?

-- 
[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!

Reply via email to