I wonder if anyone can help me with a question based more on curosity than a
desperate need to know. Say I have a data file with one key/value pair on
each line, which I want to read into a hash. I've been doing it in one of
two ways:
while (<>) {
($key, $value) = split;
$hash{$key} = $value;
}
or
push @array, split while <>;
%hash = @array;
What I'm wondering is if there is anything like:
push %hash, split while <>; # which doesn't work, or
%hash = split while <>; # but that overwrites all but the last pair.
Thanks
Mark C
--
------------------------------------------------------------------------
Dr Mark Crowe John Innes Centre
Norwich Research Park
Tel/Fax: +44 (1603) 450012 Colney
mailto:[EMAIL PROTECTED] Norwich
NR4 7UH