Multiple choice

Pick wrong piece of code for printing the Hashes in PERL Consider the hash %My_Portfolio = ('DFHL', 100, 'ITC', 250, 'ASHOKLEY', 500, 'AXISBANK', 150);

  1. print "$_n" for keys %My_Portfolio;
  2. print scalar keys %My_Portfolio;

  3. print "%My_Portfolio";

  4. @Stocks = keys %My_Portfolio; print "$Stocks[1]n";
  5. @Quantity = values %My_Portfolio; print "$Quantity[2]n";
Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Here is the trap. It takes %My_Portfolio as a string. Does not recognize as a Hash.