#!/usr/bin/perl
# Declare the hash
my %hash = ();
# Data fill the hash
%hash = (
'7C4534' => '-27.245525,153.883883',
'7C4434' => '-28.245525,153.483886',
'7C4334' => '-29.245525,153.983883',
'7C4234' => '-30.245525,153.783883'
);
# To add extra
$hash{'7C4134'} = '-31.245525,153.683883';
# Dump the hash
while ( my ($key, $value) = each(%hash) )
{
print "$key => $value\n";
}
# Check if key/value exists
#$key = 7C4234;
#if exists $hash{ $key }
#{
#print "This exists and value is => $hash {$key}\n";
#}
# Number of elements in the array
print "I am currently holding ". keys( %hash ) ." elements in my hash.\n";
#$key='7C4134'
#delete $hash{$key};
#$hash->{ '7C4134' } = '-31.245525,153.683883';
# Update a hash
$hash{'7C4134'} = 'update,update';
# Dump the hash
while ( my ($key, $value) = each(%hash) )
{
print "$key => $value\n";
}
~