Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How Best to Handle Data

by bellaire (Hermit)
on Sep 24, 2010 at 01:15 UTC ( #861711=note: print w/replies, xml ) Need Help??


in reply to How Best to Handle Data

Sure it's possible. I recommend taking a look at perldsc for an overview of data structures in Perl. One thing to keep in mind is that your second-level hash doesn't need to be named, as it is contained in the outer hash and keyed on the filenames. Per your example, you could do something like this (note that the Spreadsheet::Read documentation states that ReadData returns a array reference, not a hash):
use Spreadsheet::Read; my %H1; my @filename_list = qw(D.xls E.xls); for my $filename (@filename_list) { $H1{$filename} = ReadData($filename); } my $example = $H1{'D.xls'}->[1]->{A1}; # $example now has the value of + # cell A1 of sheet 1 of D.xls

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2019-10-17 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?