in reply to Re^2: How to convert Excel contents into a hash table and further access the contents of that hash table ?
in thread How to convert Excel contents into a hash table and further access the contents of that hash table ?

Hello ankit.tayal560,

Are you sure the error is coming from the code shown? When I run your code, accessing an Excel file created according to the table in the OP, it works without errors:

17:20 >perl 1704_SoPW.pl Azhar-->Academic Azhar-->IQ Azhar-->Music Azhar-->sports Gurmeet-->Academic Gurmeet-->IQ Gurmeet-->Music Gurmeet-->sports Jason-->IQ Jason-->Music Vishal-->Academic Vishal-->IQ Vishal-->sports 17:21 >

It may help if you detail your platform, Perl version, and Spreadsheet::ParseExcel version. Here are mine:

Also, please copy and paste the exact error message you receive (within <code> ... </code> tags).

Cheers,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

  • Comment on Re^3: 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^4: How to convert Excel contents into a hash table and further access the contents of that hash table ?
by ankit.tayal560 (Beadle) on Oct 05, 2016 at 08:12 UTC

    Yes error is coming when I run the above code, plateform which I am using is : (1) Windows 7 (2) Active state perl 5.8.9 build 825 (3) Spreadsheet::ParseExcel 0.65

    exact error message is : Can't call method "value" on an undefined value at C:\perl\perl_tests\ +excel_parser.pl line 22

      Well, you have the latest version of Spreadsheet::ParseExcel but a very old version of Perl. The oldest version I have on my computer at the moment is Strawberry Perl v5.12.3 (32 bit), which also runs the code you posted with no errors or warnings.

      The best suggestion I can make is that you check your Excel file. If I add a blank line above the header — i.e., the line containing:

      Student name IQ sports Music Academic

      — then I get the error message you reported.

      Hope that helps,

      Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,