#!/usr/bin/perl -w use strict; my ( $key, $value ); my %hash = ( rat => "acggghhh", mat => "dhhdhdhdh", ); $hash{rat} = "fhhfjfjj"; $hash{rat} = "dggdgdgdg"; while ( ( $key, $value ) = each %hash ) { print "$key and $value \n"; }