programming-examples/perl/Hash/Mix scalar, list and hash.pl
2019-11-15 12:59:38 +01:00

14 lines
330 B
Perl

%mixed_bag = (
Scalar1 => 3,
Scalar2 => "A",
List1 => [1, 2, 3],
Hash1 => { A => 'a', C => 'c' },
List2 => ['A','B', ['C','D'], 'E', 'F'],
Scalar3 => $my_object,
Hash2 => { Time => [ gmtime ],Date => scalar(gmtime),
},
List3 => @my_list[0..2],
);
print $mixed_bag{List2}[2][1];