ankit.tayal560 has asked for the wisdom of the Perl Monks concerning the following question:

use strict; use Spreadsheet::ParseExcel; my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse('perl.xls'); die $parser->error(), ".\n" if ( !defined $workbook ); for my $worksheet ( $workbook->worksheets() ) { my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); for my $row ( $row_min .. $row_max ) { for my $col ( $col_min .. $col_max ) { my $cell = $worksheet->get_cell( $row, $col ); next unless $cell; print ("Row, Col = ($row, $col)\n"); print ("Value = ", $cell->value(),"\n"); } } }

initially when I dint had Spreadsheet::ParseExcel module it showed an error Spreadsheet::ParseExcel.pm not found in @INC but now when I installed that module and trying to run this script(above one) it is showing this error "can't locate crypt/RC4.pm in @inc" can you tell me some solution and also why it is showing this type of error?

Replies are listed 'Best First'.
Re: can't locate crypt/RC4.pm in @inc
by marto (Cardinal) on Sep 07, 2016 at 09:04 UTC

      I downloaded the .tar.gz spreadsheet::parseexcel file from CPAN unzipped it and copied the lib subfolder "Spreadsheet" into the perl library folder.

        This strategy won't work well unless you know exactly what you're doing, for example this won't install dependencies or do any testing to ensure your setup will work. Modules usually have an INSTALL or README file which explain installation. A more sensible approach would be to use cpan or cpanm to do all of this for you:

        cpan Spreadsheet::ParseExcel cpanm Spreadsheet::ParseExcel

        cpan is core so you don't need to install it, cpanm requires installation but has it's advantages also. These tools will download the module, install any dependencies, run the test suite then install.

        Update: fixed typo.