in reply to Re: Re: Re: (jeffa) Re: 'print' puzzle
in thread 'print' puzzle

Parenthesis have nothing to do with it because of the way the Perl grammar is defined. From perly.y:
LSTOP indirob argexpr /* print $fh @args */ FUNC '(' indirob expr ')' /* print ($fh @args */ LSTOP listexpr /* print @args */ FUNC '(' listexprcom ')' /* print (@args) */
Looks like a typo in the second line, too.

I'm not sure I agree that this is an "indirect object", though. It looks like the parser's trying to convert anything that looks like a filehandle into a filehandle.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: (jeffa) Re: 'print' puzzle
by John M. Dlugosz (Monsignor) on Nov 13, 2001 at 09:14 UTC
    FUNC '(' indirob expr ')' /* print ($fh @args */
    Hmm, so it specifically allows parens there! I had no idea--I thought they would defeat this way of parsing.

    Also, is print special? I don't recall foo (bar (5)); ever trying to call bar->foo(5) instead.

    Is that why you don't agree that indirob is the right characterization for it?

    —John