in reply to Re: (another?) Deparse bug
in thread (another?) Deparse bug

Interesting. It does indeed compile with the semi's there! So why can't they go just about anywhere before another delimiter, since everyting is a (sub) expression?

Replies are listed 'Best First'.
Re: Re: Re: (another?) Deparse bug
by broquaint (Abbot) on Nov 01, 2002 at 18:25 UTC
    So why can't they go just about anywhere before another delimiter, since everyting is a (sub) expression?
    IANALG1 so take this with a pinch of salt :)

    Semi-colons can be put after ever statement, but not every expression. If you were to put semi-colons after every expression the you couldn't build up larger expressions e.g

    # exp # exp and exp # ( (exp || exp) and (exp || exp)) foo() || $bar->() and $baz || @quux;
    So when B::Deparse sees your code it (roughly) breaks it down into the following
    print *{ # beginning of glob dereference ${ # beginning of scalar derference $x # scalar statement to be dereferenced } # end of scalar dereference {$y} # glob statement to be dereferenced (+ ${$x} ) } # end of glob statement to be dereferenced {SCALAR} # glob slot and end of print statement
    Hopefully that clears things up. I've updated my original reply as well to be a little clearer on the issue.
    HTH

    _________
    broquaint

    1 I Am Not A Language Guru