# hash.lib # in the library sub gethash { open(FILE, "data.txt") || die "Can't open data - $!\n"; my %hash = map { (split(/:/))[0,1] } chomp(); close(FILE); return \%hash; }