Pass key and get value : Hash Definition « Hash « Perl
- Perl
- Hash
- Hash Definition
Pass key and get value
%hash = ();
$hash{fruit} = apple;
$hash{sandwich} = hamburger;
$hash{drink} = bubbly;
print $hash{sandwich};
Related examples in the same category