#!/usr/bin/perl -w use strict; ############################################################################ # First attempt - BAD - Load hash from file handle - keys contain newlines. ############################################################################ #my %person = map { $_ => 1 } ; ############################################################################ # Second attempt - GOOD - Load hash from chomped array - no newlines. ############################################################################ chomp(my @array = ); my %person = map { $_ => 1 } @array; for (keys %person) { print "$_ = $person{$_}\n"; } __DATA__ Ruth Samuel Paul John Silas