in reply to Re: Is this a reasonable data structure?
in thread Is this a reasonable data structure?

Or he could do it in a quarter of the time with half the code, without having to download and compile modules or read 1000 lines of documentation and learn SQL.

#! perl -slw use strict; use Data::Dumper; my @fields = split'\|', <DATA>; chomp $fields[-1]; my %HoH = map{ chomp; my%h; @h{ @fields } = split'\|'; ( $h{ last } . '_' . substr( $h{ first }, 0, 1 ) => \%h ) } <DATA>; print Dumper \%HoH; __DATA__ title|first|last|room|phone|email Mrs|Linda|Caralo|201|148|she@borg.org Miss|Jean|Androno|317|167|j@alo.com

prints

P:\test>test2 P:\test>test2 $VAR1 = { 'Paterman_S' => { 'email' => 'steve@net.net', 'first' => 'Steve', 'last' => 'Paterman', 'title' => 'Mr', 'phone' => '100', 'room' => '101' }, 'Caralo_L' => { 'email' => 'she@borg.org', 'first' => 'Linda', 'last' => 'Caralo', 'title' => 'Mrs', 'phone' => '148', 'room' => '201' }, 'Androno_J' => { 'email' => 'j@alo.com', 'first' => 'Jean', 'last' => 'Androno', 'title' => 'Miss', 'phone' => '167', 'room' => '317' } };

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!