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

$VAR1 = { '1' => [ { 'clz' => 'iir', 'degree' => 'b.tch', 'name' => 'ravi' }, { 'clz' => 'iir', 'degree' => 'b.tch', 'name' => 'ravi' } ], '2' => [ { 'clz' => 'iir', 'degree' => 'b.tch', 'name' => 'ravi' } ] };

This is the output iam getting for print Dumper %data

\
1$VAR1 = { 'clz' => 'nit', 'degree' => 'ph.d', 'name' => 'teja' }; 1$VAR1 = { 'clz' => 'iit', 'degree' => 'm.tech', 'name' => 'teja' }; 2$VAR1 = { 'clz' => 'iir', 'degree' => 'b.tch', 'name' => 'ravi' };

this is the output iam getting for Print Dumper %set

Replies are listed 'Best First'.
Re^11: Converting Excel to Hash
by poj (Abbot) on Jan 05, 2017 at 08:23 UTC

    You need to create a new %set hash for each row

    ##my %set =(); <- move this line inside loop my %data =(); my ($r,$val,$master_key); for my $row (1 .. $eSheet->{MaxRow}){ my %set =(); # <- move to here ..
    poj

      Thank you .It worked for me.