OK, one problem is solved, which was the path to the data file.

I know there is a simple way to read in a file like the following:

apple,2
banana,4
kiwi,1


and produce a HASH. The code below works I get the feeling there is a more
compact way to accomplish this.

-------

#!/usr/bin/perl -w

use strict;
my %prices;

my $data = "/Users/dowda/Desktop/tmp test/test.txt";

open (FH,$data)  || die  "could not open $data $!";

local $/; 

my $tmp = <FH>;
my @tmp =  split (/\n/,$tmp); 

close FH;

for (@tmp) {
my ($k,$v)  = split /,/;
$prices{$k} =$v; 
}

for my $key (keys %prices){

print "$key = $prices{$key}\n";

}


Thanks for any pointers here,

Dave


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to