Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^3: Unexpected parsing

by ikegami (Pope)
on Dec 16, 2009 at 16:59 UTC ( #813035=note: print w/replies, xml ) Need Help??

in reply to Re^2: Unexpected parsing
in thread Unexpected parsing

Is there any unified list of officially undefined things?

That's the only one that comes to mind. It's documented (too specifically) in perlsyn under statement modifiers (my ... if ...;).

I know, for example, by luck, that $i++ + ++$i can officially do whatever it wants

That one's simply undocumented.

I wonder if it might be appropriate for the precedence table to mention this unexpected (by me) interaction?

I don't see why not, although I don't think it'll ever be an issue in legit code (but my brain is too slow to make sure of that right now). Maybe as a warning in the doc for the cond op.

Replies are listed 'Best First'.
Re^4: Unexpected parsing
by JadeNB (Chaplain) on Dec 16, 2009 at 17:41 UTC
    That one's simply undocumented.
    From Auto increment and Auto decrement:
    Note that just as in C, Perl doesn't define when the variable is incremented or decremented. You just know it will be done sometime before or after the value is returned. This also means that modifying a variable twice in the same statement will lead to undefined behaviour.
    (with the specific example I mentioned listed under “Don't do that”).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://813035]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2021-05-11 13:42 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (116 votes). Check out past polls.