top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Excel Sheet Gen Perl Code gives error

0 votes
333 views

I have written simple EXCEL sheet gen PEARL code:

 #!/usr/bin/perl

 use strict;
 use Spreadsheet::WriteExcel;

 my $workbook = Spreadsheet::WriteExcel->new("simple.xls");
 my $SUMMARY = $workbook->add_worksheet("SUMMARY");

 $SUMMARY->write(0, 0, "START");
 $SUMMARY->write(0, 2, "A");

But it gives following error when I execute through:

perl excel_sheet.pl
Can't locate Spreadsheet/WriteExcel.pm in @INC (@INC contains: /usr/perl5/5.8.4/lib/sun4-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at excel_sheet.pl line 4.
BEGIN failed--compilation aborted at excel_sheet.pl line 4.
posted Jul 15, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote
 
Best answer

Have you installed SpreadSheet::WriteExcel module ? ,

if no => then install it from cpan shell or you can download it from (http://search.cpan.org/CPAN/authors/id/J/JM/JMCNAMARA/Spreadsheet-WriteExcel-2.39.tar.gz link)

follow the instruction:

wget link 
tar -xzvf file.gz
cd newlycreateddir 
perl Makefile.PL PREFIX="/path/to/your/testing/area"
 make
 make test
answer Jul 15, 2013 by anonymous
+1 vote

You do not seem to have the module installed. If you have cpanm, you may try:

 $ cpanm Spreadsheet::WriteExcel
answer Jul 15, 2013 by anonymous
Similar Questions
+2 votes

I recently used the Perl Framework, which is a Perl centric Http test kit. I followed the instructions mentioned in the readme available within the framework which I checked out from the link

http://svn.apache.org/repos/asf/httpd/test/framework/trunk/

The readme states the following steps:
1. You need an installation of Apache. (Either 1.3 or 2.0)
2. Any DSOs you wish to use should be configured in that Apaches
httpd.conf (the test harness will pick this configuration up)
3. Setup:
perl Makefile.PL -apxs /path/to/apache/bin/apxs
4. Run the tests:
t/TEST
5. Evaluate test output.

However, I get an error when I get to the 3rd step saying;

"Cant open perl script "/Perl": No such file or directory"

Hope someone could clarify whats happening here.

+1 vote
$ perl -le 'system "df -h"'
$ perl -le 'system "df","-h"'

Both two styles work fine. What's the difference between them and which is better usage?

+1 vote

I've a program that needs to print some fields formatted in different ways according to some conditions. The solution I come up is working, but I'm looking for a suggestion for something more elegant.

What I do is something like the following:

print sprintf $formats[ $condition ], @fields;

where $condition is the condition used to select a sprintf format string out of an array (@formats) that contains something like:

my @formats = (
 qw( %09d %-1s %03d ... )
, qw(%-4s %1s %09d %1s %-150s %-4s %011d)
, ...
);

Now, while this approach is working really fine, it is a little hard to decode, especially considering that I've got some formats with 50+ fields. I don't believe that using Perl formats is a solution, it will provide a quite longer configuration (consider I've got even fields specified as "-100%s"!).

Any suggestion to get a more readable code?

0 votes

How can write a python script which will execute some perl scripts in a gui and shouldn't be post processed....?

+1 vote

I have a Linux machine and windows machine, I need to run a GUI of Linux machine on the windows machine.
I don't want to use putty or any other software. I have to use any Perl modules to achieve this please help.

...