On Jun 6, 2012, at 11:33 AM, rbm wrote: > Hi, > > I'm using perl module Spreadsheet::ParseExcel here > http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.59/lib/Spreadsheet/ParseExcel.pm. > > I have a Excel spreadsheet which has 8 worksheets in and I would like > to parse just worksheets 3 and 4. > > I've tried amending this line in my script every which way but with no > joy. > > for my $worksheet ( $workbook->worksheets() ) { > > The documentation says that the worksheets() method returns an array > of worksheets but I cant seem to reference any of these in the usual > way in order to syphon out the worksheets that I don't need either. > > When I print out $worksheet I get > > Spreadsheet::ParseExcel::Worksheet=HASH(0x61e3d0) > Spreadsheet::ParseExcel::Worksheet=HASH(0xf9b9b0) > Spreadsheet::ParseExcel::Worksheet=HASH(0xf9ba60) > Spreadsheet::ParseExcel::Worksheet=HASH(0xf9cab0) > Spreadsheet::ParseExcel::Worksheet=HASH(0xf9cb40) > Spreadsheet::ParseExcel::Worksheet=HASH(0xf9cbd0) > Spreadsheet::ParseExcel::Worksheet=HASH(0xf9cc60) > Spreadsheet::ParseExcel::Worksheet=HASH(0xf9ccf0)
The worksheets() method returns an array of worksheet objects. You can then call methods on the worksheet object to extract data from that worksheet. You can retrieve a specific worksheet object either by name or by index (0-7 in your case). Please see the documentation for the Spreadsheet::ParseExcel module, specifically the Workbook section that describes the worksheets() and worksheet() methods. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/