howie has asked for the wisdom of the Perl Monks concerning the following question:
then for each line after,@fieldnames = split(/$separator/,$firstline);
to get a hash of the data as field=value pairs. How do I get a list of these saved up? it isn't push(@datalist,\%data); because that's just a ref to the one hash. I think I need a line like the 1 but to produce a hashref to an anonymous hash instead, but what is it?@fields = split(/$separator/,$line); @data{@fieldnames} = @fields; # [1]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: list of hashrefs?
by chromatic (Archbishop) on Jan 31, 2001 at 21:06 UTC | |
by howie (Sexton) on Jan 31, 2001 at 21:18 UTC | |
|
Re: list of hashrefs?
by jeroenes (Priest) on Jan 31, 2001 at 21:59 UTC | |
|
Re: list of hashrefs?
by petral (Curate) on Feb 01, 2001 at 03:16 UTC |