in reply to Re: parsing text file into a hash?
in thread parsing text file into a hash?
but his text seems to say he wants this:yours makes %names = name => bob => jane joe => sue name2 => john => me oh => my
if this is really what is wanted, try this slight change:yours makes %names = name => first => bob second => jane third => joe fourth => sue name2 => first => john second => me third => oh fourth => my
'The fickle fascination of and Everlasting God' - Billy Corgan, The Smashing Pumpkinsuse strict; my %names; while (<>) { my ($label, $name1, $name2, $name3, $name4) = split /:/; $names{$label}{"first"} = {$name1} $names{$label}{"second"} = $name2; $names{$label}{"third"} = {$name3} $names{$label}{"fourth"} = $name4; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: parsing text file into a hash?
by ralfthewise (Sexton) on Jun 15, 2001 at 22:53 UTC | |
by runrig (Abbot) on Jun 15, 2001 at 23:46 UTC |