in reply to (another?) Deparse bug

Somehow I don't thing the interior semi's belong there.
Since they're just statements they fit in quite nicely, and help to clarify the statement as a whole. It's really just saying "dereference the result of this statement", and it makes things a little simpler if it's made clear where each statement ends.
HTH

_________
broquaint

update: changed s/expression/statement/ as expression in the given context is inaccurate

Replies are listed 'Best First'.
Re: Re: (another?) Deparse bug
by John M. Dlugosz (Monsignor) on Nov 01, 2002 at 17:19 UTC
    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?
      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

Re: Re: (another?) Deparse bug
by John M. Dlugosz (Monsignor) on Nov 01, 2002 at 18:38 UTC
    So the thing being dereferenced is a statement, not an expression, just like the body of a loop? Hmm, but statements don't carry values...that's what makes something an expression!