Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How Best to Handle Data

by bellaire (Hermit)
on Sep 24, 2010 at 01:15 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://861711]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-19 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found