Multiple choice technology web technology

which option is correct when $def = \%any_hash ?

  1. all key value pairs are copied but in random order

  2. all key value pairs are copied in proper order

  3. all key value pairs from def may not be copied into abc

  4. syntax error

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In Perl, assigning a reference to a hash ($def = \%any_hash) copies the reference. If the question implies copying the contents (e.g., %def = %any_hash), Perl hashes are unordered collections, so copying them yields the same key-value pairs but in a randomized internal order.