Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

how to run this script

by kurtcobain (Novice)
on Oct 05, 2012 at 17:05 UTC ( #997519=perlquestion: print w/replies, xml ) Need Help??
kurtcobain has asked for the wisdom of the Perl Monks concerning the following question:

#!/usr/bin/perl -w use strict; use Spreadsheet::ParseExcel; my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse('siemens.xls'); if ( !defined $workbook ) { die $parser->error(), ".\n"; } 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"; print "Unformatted = ", $cell->unformatted(), "\n"; print "\n"; } } }
Hi, i started learning perl a couple of days ago. i try to run the above script with command perl . it throws an error Can't locate Spreadsheet/ in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at line 4. BEGIN failed--compilation aborted at line 4. Please help me to run this script.thanks

Replies are listed 'Best First'.
Re: how to run this script
by CountZero (Bishop) on Oct 05, 2012 at 17:09 UTC
    It seems you do not have Spreadsheet::ParseExcel installed.

    On the command line try "cpan Spreadsheet::ParseExcel". That should install it for you.


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
      thanks ..its working. whats the difference between running a perl script with command ./filename and perl filename . when i do ./filename it gives error bash: ./ Permission denied Please help
        when i do ./filename it gives error bash: ./ Permission denied
        You probably need to give your file execute permissions, like:
        chmod 777

        Also, conventionally, the .pm file name suffix is reserved for Perl module files (see package). It is more common to use the .pl file extension for scripts.

Re: how to run this script
by davido (Archbishop) on Oct 05, 2012 at 17:12 UTC
      set the permission..thanks guys

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://997519]
Approved by Corion
[haukex]: What Every Computer Scientist Should Know About Floating-Point Arithmetic?
[Discipulus]: the winner is..
[Discipulus]: Mr haukex from Germany! thanks a lot to the other parteciapant our dear Mr afoken.. ;=)
[Discipulus]: no, seriously thanks both, i missed 'scientist' and 'floating point' and the resarche was imposible..
Discipulus go to his cell to bookmark this
[haukex]: Well to be honest I just did a super search for "every should know floating" ;-)
[Discipulus]: floating was the keyword and.. to use supersearch is plus sign not a (plus) sin

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-06-26 20:51 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (594 votes). Check out past polls.