Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Spreadsheet::XLSX Cell Access

by duelafn (Priest)
on Sep 13, 2013 at 01:12 UTC ( #1053820=note: print w/ replies, xml ) Need Help??


in reply to Spreadsheet::XLSX Cell Access

Try:

my %yield; my @mycols = ('F', 'G', 'H', 'I', 'J', 'K'); foreach (@mycols) { $yield{$_} = $sheet->{$_ . "35"}; }

Could also use $sheet->{"${_}35"} on the right hand side, its a stylistic preference there. The key is use a hash for the yield, use double-quotes when including a variable, and you need a way do distinguish $_ concatenated with 35 from the single variable $_35 (that's what the braces in "${_}35" are doing - telling perl that just _ is the variable not _35).

Good Day,
    Dean


Comment on Re: Spreadsheet::XLSX Cell Access
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-04-20 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls