Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Hash of Hashes not filling - only using last line of file

by poolpi (Hermit)
on Feb 22, 2013 at 08:10 UTC ( [id://1020101]=note: print w/replies, xml ) Need Help??


in reply to Hash of Hashes not filling - only using last line of file

You have to put your hash out of the while loop.

#!/usr/bin/perl -w use strict; use Data::Dumper; my %IACISBN_ENUM; while ( my $line = <DATA> ) { chomp($line); my ( $IacIsbn, $Title, $EPI, $BundleCode ) = split( "\t", $line ); $IACISBN_ENUM{$IacIsbn} = { 'Title' => $Title, 'EPI' => $EPI, 'Bundle' => $BundleCode }; } print Dumper \%IACISBN_ENUM; __END__ IacIsbn Title EPI BundleCode


hth,
PooLpi

The stone that the builder refused, will always be the head cornerstone.
[ Robert Nesta MARLEY ]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1020101]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-20 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found