#!/usr/bin/perl -w use strict; my &hash; while () { $hash{$first} = $second; # only grabs the last value } while ((my $key, my $value) = each %construct) { print "The $key is: $value \n"; } _DATA_ 5 25 6 27 5 24 5 23 6 29 6 30 4 22 5 25 6 27 4 22 4 21 #### The Key is: 5 25 24 23 The Key is: 6 27 29 30 The Key is: 4 22 21