Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 taking refuge in the Monastery: (5)
As of 2015-07-30 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls