in reply to Re: Getting the Value of a single hash key
in thread Getting the Value of a single hash key

Here is the code:
my $path; my %hash = (); #created items/objects my $line; while ($line = <CREATEFILE>) { chomp($line); ($src, $key) = split (/=/, $line); push( @{$hash{$key}}, $src); }

Replies are listed 'Best First'.
Re: Re: Re: Getting the Value of a single hash key
by dogz (Initiate) on May 06, 2003 at 20:19 UTC
    Here is an example of the data. The second file handle does not have unique keys so I can't build a hash to test with it.

    There are two source files:

    #Listings Filehandle <CREATEFILE> Source1=Times Source2=DJNews Source3=Yahoo #Repeat Stocks Filehandle <F> F=Source1 F=Source3 LNUX=Source2 AMZN=Source1 INTL=Source3 INTL=Source1