constant takes a hash reference as its argument, and random order doesn't matter in this case, because each directive is named, not positional. There is no ambiguity.
constant puts its parameter (the hash ref) into a variable called $multiple on line 59, then on line 69, commences a check to see if the param is in fact a hash ref, and will croak if it isn't.
Further, this has nothing to do with the run phase either. You can't assign a hashref to a variable and then expect it to work in a use statement because the use is executed at compile time, but the hash is created at runtime. The reason your latter example works is because you're forcing $clist to be created prior to the use constant ... line by creating it at compile time one line above in another use statement. You could achieve the same thing with this:
my $clist; BEGIN { $clist = {a => 1, b => 2}; } use constant $clist;
In reply to Re: Curious: are anon-hashes in random order?
by stevieb
in thread Curious: are anon-hashes in random order?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |