And to further confirm that it's only working on 5.8.0, it doesn't work on 5.8.1 either ;-)
Liz
Update:
With the environment variable PERL_HASH_SEED set to 0, the output is indeed "JUST ANOTHER PERL HACKER". If set to another value, it is always the same, but definitely not Just Another Perl Hacker. Without the environment variable set, the output is different each time you run it.
Since I can't refer to the new documentation of "perlrun" on perldoc.com, I'll just pit it here for those of you who are interested:
- PERL_HASH_SEED
- (Since Perl 5.8.1.) Used to randomise Perl's
internal hash function. To emulate the
pre-5.8.1 behaviour, set to an integer (zero
means exactly the same order as 5.8.0).
"Pre-5.8.1" means, among other things, that
hash keys will be ordered the same between
different runs of Perl.
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.
If PERL_HASH_SEED is unset or set to a non-
numeric string, Perl uses the pseudorandom
seed supplied by the operating system and
libraries. This means that each different run
of Perl will have a different ordering of the
results of keys(), values(), and each().
See "Algorithmic Complexity Attacks" in
perlsec for more information.
- PERL_HASH_SEED_DEBUG
- (Since Perl 5.8.1.) Set to "1" to display (to
STDERR) the value of the hash seed at the
beginning of execution.
FInally, setting $ENV{PERL_HASH_SEED}=0 during execution does not have the desired effect: the environment variable is checked during startup of Perl, looong before you can set Perl's copy of the environment variable.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.