in reply to Re^3: To each() their own
in thread To each() their own

yes I agree that that was a bit vague. What I actually wanted to state was that assuming Perl is not broken for some other reason that the behavior of each() whatever it may be for a given circumstance under the condition of being called after an insert into the has is okay by me, I.E. I can live the possibly random pair of key/value returned.

Replies are listed 'Best First'.
Re^5: To each() their own
by shmem (Chancellor) on May 02, 2017 at 20:25 UTC
    What I actually wanted to state was that assuming Perl is not broken for some other reason that the behavior of each()

    Perl is not broken here, and the documentation has a warning about inserting hash tuples whilst iterating. As I wrote, per evidence from the source, this warning is only triggered if perl is compiled with PERL_HASH_RANDOMIZE_KEYS. This doesn't mean that such operation is safe for versions that don't emit this warning.

    And ceterum censeo that XS code not being able to propagate their file/lineno to perl internals is, if not a bug, an annoying lack of a basic feature that the XS subsystem should provide. (update: but see update to Re^3: To each() their own)

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'