[0] Perl> @x = split( '[, ]', $_ ), push @{ $bySurname{ $x[0] }{ $x[1] } }, [ @x[ 2, 3 ] ] for split /\n\s/, <<'END' Smith,John (248)-555-9430 jsmith@aol.com Hunter,Apryl (810)-555-3029 april@showers.org Stewart,Pat (405)-555-8710 pats@starfleet.co.uk Ching,Iris (305)-555-0919 iching@zen.org Doe,John (212)-555-0912 jdoe@morgue.com Jones,Tom (312)-555-3321 tj2342@aol.com Smith,John (607)-555-0023 smith@pocahontas.com Crosby,Dave (405)-555-1516 cros@csny.org Johns,Pam (313)-555-6790 pj@sleepy.com Jeter,Linda (810)-555-8761 netless@earthlink.net Garland,Judy (305)-555-1231 ozgal@rainbow.com END ;; [0] Perl> pp %bySurname;; ( "Jeter", { Linda => [["(810)-555-8761", "netless\@earthlink.net"]] }, "Ching", { Iris => [["(305)-555-0919", "iching\@zen.org"]] }, "Smith", { John => [ ["(248)-555-9430", "jsmith\@aol.com"], ["(607)-555-0023", "smith\@pocahontas.com"], ], }, "Crosby", { Dave => [["(405)-555-1516", "cros\@csny.org"]] }, "Jones", { Tom => [["(312)-555-3321", "tj2342\@aol.com"]] }, "Doe", { John => [["(212)-555-0912", "jdoe\@morgue.com"]] }, "Johns", { Pam => [["(313)-555-6790", "pj\@sleepy.com"]] }, "Hunter", { Apryl => [["(810)-555-3029", "april\@showers.org"]] }, "Garland", { Judy => [["(305)-555-1231", "ozgal\@rainbow.com\n"]] }, "Stewart", { Pat => [["(405)-555-8710", "pats\@starfleet.co.uk"]] }, )