in reply to Re^6: Converting Excel to Hash
in thread Converting Excel to Hash

The line push @{ $data{$master_key}}, \%set;
should be inside the foreach $row ( 1 .. $eSheet->{MaxRow} ) loop.

If you indent your code sensibly you will see the error more easily.

poj

Replies are listed 'Best First'.
Re^8: Converting Excel to Hash
by ravi179 (Novice) on Jan 04, 2017 at 12:11 UTC
    Excel Format: ID Name Degree CLZ 1 Teja ph.d nit ph.d iit 2 Ravi B.tech iir output: $var1 ='1'; $var2=[ { clz=>nit, degree=>ph.d, name=>teja } ] $var1='1' $var2=[ { clz=>iit, degree=>ph.d, name=>teja }, $var2->[0](Why this is coming) ]; $var1='2' $var2=[ { clz=>iir, degree=>b.tech, name=>ravi. }, $var2->[0]; ] ##(What is this additional block) $Var3='2'; $Var4=[ $var2->[0] ];

      Can anyone please explain me why $var2->[0],$var3,$var4 are coming.