harcharn has asked for the wisdom of the Perl Monks concerning the following question:

I am very new to perl and using version 5.16.3; do I need to install a module to open a excel spreadsheet..? I am currently using this test code

#!/usr/bin/perl use strict; use warnings; use Spreadsheet::Read; my $workbook = ReadData ("test.xls"); print $workbook->[1]{A3} . "\n";

I'm getting an error at line 5...?

Replies are listed 'Best First'.
Re: open excel file..?
by Corion (Patriarch) on Nov 11, 2013 at 15:03 UTC

    What is the exact error message you get?

    What is line 5?

    Yes, usually you need to install modules. The cpan tool is distributed with your version of Perl and can be used to install missing modules:

    cpan Spreadsheet::Read

    This should be all you need to get the module installed.

    You might want to consider that 5.6.3 is a very old version of Perl which is not readily supported by some modules. Consider using a more recent version of Perl. The post says 5.16.3, not 5.6.3.

      Can’t locate Spreadsheet/Read.pm in @INC (@INC contains: C:/Perl164/site/lib C:/Perl164/lib .) at C:\perl_scripts\read.pl line 5.

      BEGIN failed—compilation aborted at C:\perl_scripts\read.pl line 5.

Re: open excel file..?
by technojosh (Priest) on Nov 11, 2013 at 19:37 UTC
    Short answer - Yes, you will probably want to install a module or two...

    I interact with Excel using Win32::OLE

    Take a look at: Win32::OLE - Examples

      Although I personally would prefer to use Win32:OLE, that might not be an option for the OP based on the first line of code (#!/usr/bin/perl), which would seem to indicate that he/she is on a *nix like OS instead of Windows. If that's true, then Win32::OLE can't be used.

Re: open excel file..?
by Jer2911 (Acolyte) on Nov 12, 2013 at 14:22 UTC
    Spreadsheet:ParseExcel is your best bet. It is straightforward and has good documentation. You can install it using ppm, which makes installation easy.