programming-examples/perl/Hash/Setting values into a hash named %hash.pl

15 lines
215 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
$hash{"Name"} = "G ";
$hash{23} = 365;
$hash{123.45} = "Hello world";
$key = 123.45;
print "Element 123.45: $hash{$key}\n";
$key = "Name";
print "Element Name: $hash{$key}\n";