Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: random behaviour of perl hashes

by swampyankee (Parson)
on Aug 28, 2006 at 20:48 UTC ( #570046=note: print w/replies, xml ) Need Help??


in reply to Re^2: random behaviour of perl hashes
in thread random behaviour of perl hashes

I get this running ActiveState's 5.8.8 (build 817):

Case 1 salt shaken onions diced pepper fresh paprika spicy potatos diced Case 2 salt shaken onions diced pepper fresh paprika spicy potatos diced Case 3 salt shaken onions diced pepper fresh paprika spicy potatos diced

I suspect that it has to do with the details of the implementation of the hashing algorithm, which may differ from system to system.

My interpretation of the "random ordering" in the perldocs is simply that "we refuse to guarantee the order of the keys for a hash".

emc

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

Albert Einstein

Replies are listed 'Best First'.
Re^4: random behaviour of perl hashes
by liz (Monsignor) on Aug 28, 2006 at 20:57 UTC
    According to "perlrun":

    The default behaviour is to randomise unless the PERL_HASH_SEED is set. If Perl has been compiled with "-DUSE_HASH_SEED_EXPLICIT", the default behaviour is not to randomise unless the PERL_HASH_SEED is set.

    perhaps ActiveState Perl is compiled with -DUSE_HASH_SEED_EXPLICIT ?

    perl -V
    might tell you whether that is the case.

    Liz

      perl -v returns (among many other data):

      -GF -W3 -MD -Zi
      -DNDEBUG -O1 -DWIN32
      -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT
      -DNO_HASH_SEED
      -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT
      -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX

      It would seem not, unless -DNO_HASH_SEED has a similar effect.

      emc

      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

      Albert Einstein

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://570046]
help
Chatterbox?
Discipulus is going mad with the new win10 client.. tried mv Cortana /dev/null but no succes
[Corion]: Ouch - another pretrained set is available, using images from IMDB and Wikipedia. So I expect interesting results for non-PR images where people are pictured that are not made up
[Corion]: Discipulus: Yeah, from my investigations, you can somewhat silence+disable Cortana, but some services of it remain always running unfortunately. What a waste of resources :-/
[Corion]: I hope you had a good weekend still ;)
choroba had a workshop with the band
[choroba]: which counts as a good weekend
[Discipulus]: yes, (at least until Sun afternoon...): Saturday we got splendid birthday party in a park: lot of eat, drink and children amusement: bag running, magnetic fishing, rope and that big pot full of candies to smash with a club

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2017-09-25 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (277 votes). Check out past polls.

    Notices?