programming-examples/perl/Hash/Merge two hash variable.pl

10 lines
192 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$h1{fruit} = apple;
$h1{sandwich} = hamburger;
$h1{drink} = bubbly;
$h2{cake} = chocolate;
$h2{pie} = blueberry;
$h2{'ice cream'} = pecan;
%h3 = (%h1, %h2);
print $h3{'ice cream'};