in reply to How to convert Excel contents into a hash table and further access the contents of that hash table ?

Hi ankit.tayal560,

You need to break up your get_cell subroutine calls to avoid processing blank cells i.e. change every instance of:

$key_var = $worksheet->get_cell($x,$y)->value

to something like

$cell = $worksheet->get_cell($x,$y); next unless $cell; $key_var = $cell->value;

Additionally, I would change for my $row(1..$worksheet->row_range) to for my $row(1..($worksheet->row_range)[1]) - the row_range subroutine returns a list, not a scalar

I hope that helps, good luck!
Shadowsong

  • Comment on Re: How to convert Excel contents into a hash table and further access the contents of that hash table ?
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: How to convert Excel contents into a hash table and further access the contents of that hash table ?
by ankit.tayal560 (Beadle) on Oct 06, 2016 at 10:16 UTC

    thanks for the guidance. it did work! thanks again