#!/usr/bin/perl use strict; use warnings; my %hash; my $l; my @values; while () { chomp; my ($key, $rest) = split /-/; push @{$hash{$key}},$rest; } $l=14; @values= exists $hash{$l} ? @{$hash{$l}}:undef; { print "\n Hash Value of 14 : @{$hash{$l}} \n"; } exit(0); __DATA__ 5-ax 14-vor 65-em 14-auf 14-ab