in reply to Re: another 'array to hash' question
in thread another 'array to hash' question
my @a; while (<INFILE>) { my ($fn, $ln, $age) = split("\t", $_); # now convert this array to a hash and stuff it in the array push(@a, {'fn'=>$fn, 'ln'=>$ln, 'age'=>$age}); }
DBI returns a nicely prepared array of hashes with fetchall_arrayref({}) and I was trying to "emulate" that while using text files. But, "if I could", I would probably find other uses as well.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: another 'array to hash' question
by stajich (Chaplain) on Dec 10, 2003 at 15:40 UTC | |
by etcshadow (Priest) on Dec 10, 2003 at 15:55 UTC | |
|
Re: Re: Re: another 'array to hash' question
by allolex (Curate) on Dec 10, 2003 at 15:15 UTC | |
by punkish (Priest) on Dec 10, 2003 at 15:38 UTC | |
by allolex (Curate) on Dec 10, 2003 at 16:41 UTC |