Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Incrementing a Hash Value

by Abigail-II (Bishop)
on Jun 14, 2002 at 12:53 UTC ( [id://174489]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Incrementing a Hash Value
in thread Incrementing a Hash Value

Why should I? Please provide a pointer to the documentation that specifies your code is correct. In one of my other replies I've specified a reference saying that's undefined.

Abigail

Replies are listed 'Best First'.
Re: Re: Incrementing a Hash Value
by Sifmole (Chaplain) on Jun 14, 2002 at 13:04 UTC
    So you can't, okay. I know theory says it is undefined, however I have never encountered a version of Perl on any machine that did not follow that execution pattern. I can spout theoretical science which tells me that I can count on nothing I write executing as I expect -- but lucky me it usually does.

      You have not yet encountered a perl that didn't execute it in this way. You have been lucky in that all perls to date have happened to execute it in one particular order.

      Abigail has repeatedly pointed out with references to the documentation that the behavior is officially undefined. What would happen if a hypothetical JPerl reimplemented perl (as currently documented) in Java, but it chose a different behavior for postincrement? Oops, your code won't work because of an incorrect assumption about how postincrement will behave.

      Granted this is a hypothetical. But it remains the case that relying on undefined behavior is a sloppy practice and probably bound to eventually screw you over.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found