finhagen has asked for the wisdom of the Perl Monks concerning the following question:

Thanks to the generous assistance of the wise perl monks I am enjoying success parsing excel spreadsheets with perl. However, there is one issue I have not been able to address on my own. The script I borrowed and modified uses an array to capture and iterate through the tabs in the Excel Workbook
foreach my $sheet (@{$workbook->{Worksheet}})
That works fine, but in some cases I would prefer to have the ability to to specify just one tab/sheet to parse. I have looked through the documentation but can't find an example of the code I am seeking. I have also tried a couple of code snippits to provide that granularity
my $sheet ={$workbook->{Worksheet[0]}}
but they error out during the compile. Can someone help me with the correct syntax to pick the specific sheet/tab within the Excel Workbook? Thanks so much.


Hagen Finley

Boulder, CO

Replies are listed 'Best First'.
Re: Specifying Individual Sheets Using Spreadsheet::ParseExcel
by jethro (Monsignor) on Oct 18, 2008 at 16:21 UTC
    my $sheet =$workbook->{Worksheet}[0] does what you want