Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by poolpi (Hermit)
on Feb 22, 2013 at 08:10 UTC ( #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 ]


Comment on Re: Hash of Hashes not filling - only using last line of file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2015-07-06 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (84 votes), past polls