in reply to extracting data from CSV files and making hash of hashes
I'm not very familiar with the CSV module, because parsing CSVs is something that Perl does very well natively.
Everything is fine up until the my $csv = Text::CSV->new(); At that point you should probably be doing:
This is nearly identical to a question answered by BrowserUK in this node: creating hash of hashes from input fileopen (CSV, "<", $file) or die $!; my %subhash; for my $line ( split "\n" ) { my( $key, $value ) = split /\s+;\s+/, $line; $subhash{ $key } = $value; } $hash{ $subhash{ $file } } = \%subhash; }
|
|---|