> im trying to use Spreadsheet::ParseExcel::Simple to return > the name of the worksheet. but all i get is something such as: > Spreadsheet::ParseExcel::Simple::_Sheet=HASH(0x39b8918) > > what am i doing wrong?
It's returning a reference to a hash it looks like. I've never used that module so I couldn't tell you for sure but try somehting like I have below :: > > code: > > use strict; > use Spreadsheet::ParseExcel::Simple; > my $wkbook = "x:/traffic/temp_assay/site.xls"; > > my (@sheets,$dest,$sheet,$year,$date,@wktemp,$ath,$bth,$cth); > my $xls = Spreadsheet::ParseExcel::Simple->read("$wkbook"); > foreach my $sheet ($xls->sheets) { > @sheets = $xls->sheets; Why do you set the list of sheets when you're inside a loop working on one sheet ? I see why you were trying it but then you just use the first element in it every time. I'd move it before the foreach statemen so it only has to run sheets() once instead of once for every sheet > while ($sheet->has_data) { > my @data = $sheet->next_row; > my $sheet = $sheets[0]; > print "$sheet\n"; print ${$sheet}{$sheets[0]}; this may or may not do it since I'm not familiar w/ the module but it's the right idea. You need to see the module's docs about how it sets up references and perhaps brush up on understanding perl refernces. They will help you out very much. DMuey > } > > thanks > > Antonio Quinonez > Traffic Analyst > Accessline Communications > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]