Operating System - HP-UX
1820553 Members
2394 Online
109626 Solutions
New Discussion юеВ

How to use Perl Module Spreadsheet::WriteExcel module

 
SOLVED
Go to solution
Mike_305
Super Advisor

How to use Perl Module Spreadsheet::WriteExcel module

Hi,

I have installed the perl module, do I need to do anything else like installing in Perl module using following commands or how it creates the excel files.



******************************
perlmodlib Perl modules: how to write and use

perlmodstyle Perl modules: how to write modules with style

perlmodinstall Perl modules: how to install from CPAN

perlnewmod Perl modules: preparing a new module for distribution.

********************************

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.
9 REPLIES 9
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: How to use Perl Module Spreadsheet::WriteExcel module

No, if you have run the install scripts then you are good to go (assuming you know how to use the functions/methods in this module). The installation, if you did the "make install" will install the Module in its normal location on your platform and will also install the man pages. You should be able to "man Spreadsheet::WriteExcel" after the installation.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: How to use Perl Module Spreadsheet::WriteExcel module

Hi Mike:

If you have followed the standard steps for installing Perl modules, then every should be ready for you to use the module you installed.

Regards!

...JRF...
David Bellamy
Respected Contributor

Re: How to use Perl Module Spreadsheet::WriteExcel module

Mike you don't have to install any other modules to use Spreadsheet::WriteExcel.

just try something like this

#!/usr/bin/perl
use strict;
use diagnostics;
use Spreadsheet::WriteExcel;

my $workbook=Spreadsheet::WriteExcel->new("name of excel file to create");
my $worksheet=$workbook->add_worksheet();

read the manpage on Spreadsheet::WriteExcel it has some good examples.
H.Merijn Brand (procura
Honored Contributor

Re: How to use Perl Module Spreadsheet::WriteExcel module

Strange question, the way you put it.

Did you install 'perl' and want to install 'Spreadsheet::WriteExcel' or did you install Spreadsheet::WriteExcel in an existing perl environment, and now wonder how to use it?

In the first case, the easiest way is to use CPAN, which is shipped with every perl:

# perl -MCPAN -e'install Spreadsheet::WriteExcel'

As Spreadsheet::WriteExcel depends on other modules, this command will ask you to accept the installation of the other modules too. You might need root access to install all these. If it is the first time you run -MCPAN, it will also ask some other questions to setup the CPAN environment to suit your needs.

In the second case, try

# perldoc Spreadsheet::WriteExcel

or

# man Spreadsheet::WriteExcel

Enjoy, Have FUN! H.Merijn [ who could not resist a smile reading that the perl module was installed ]
Enjoy, Have FUN! H.Merijn
Mike_305
Super Advisor

Re: How to use Perl Module Spreadsheet::WriteExcel module

Hi Merijn,

We download one of your scripts and it is giving error on the following line.

sub usage ()

($xls //= $title) =~ s/\.csv$/.xls/;

Any one can help. Appreciate your help.

Regards,

Mike
If there is problem then don't think as problem, think as opportunity.
Mike_305
Super Advisor

Re: How to use Perl Module Spreadsheet::WriteExcel module

Sorry forgot to attach the file.
If there is problem then don't think as problem, think as opportunity.
Hein van den Heuvel
Honored Contributor

Re: How to use Perl Module Spreadsheet::WriteExcel module

Looks like that is a Procura special...
Look at the name mentioned for the following entry in "perl581delta.pod"

==================
A new operator // (defined-or) will be available. This means that one will be able to say

$a // $b
instead of

defined $a ? $a : $b
and

$c //= $d;


instead of

$c = $d unless defined $c;

The operator will have the same precedence and associativity as ||. A source code patch against the Perl 5.8.1 sources will be available in CPAN as authors/id/H/HM/HMBRAND/dor-5.8.1.diff.
================

fwiw,
Hein.



Hein van den Heuvel
Honored Contributor

Re: How to use Perl Module Spreadsheet::WriteExcel module



btw... The header to the section with the above text reads:

"Future Directions
The following things might happen in future. "

Maybe they did not happen for your perl install.


I think you can replace the code line with (untested):

$xls = $title unless defined $xls;
$xls =~ s/\.csv$/.xls/;


btw 2... it was tempting to jokingly reply that the error really meant 'foul language ahaed'.

Hein.

Mike_305
Super Advisor

Re: How to use Perl Module Spreadsheet::WriteExcel module

Thanks for your help.
If there is problem then don't think as problem, think as opportunity.