Google News
logo
Perl - Quiz(MCQ)
Which of the following code create a reference for a hash?
A)
$ref = \$foo;
B)
$ref = \%ENV;
C)
$ref = \@ARGV;
D)
$ref = \&PrintHash;

Correct Answer :   $ref = \%ENV;


Explanation : You can create a reference for any hash by prefixing it with a backslash as follows - $ref = \%ENV;

Advertisement