Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Unexpected parsing

by ikegami (Patriarch)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2023-02-03 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (28 votes). Check out past polls.

    Notices?