CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
spreadsaheet::excel question

 



demon01
Novice

Jun 18, 2009, 12:13 PM

Post #1 of 5 (1819 views)
spreadsaheet::excel question Can't Post

I am using spreadsheet::excel (obviouslySmile and I am running into a, perhaps stupid, problem.

I can write an excel worksheet with several books in it but I cant get it to save in the server location I need the file to be.

I am using

Code
my $workbook = Spreadsheet::WriteExcel->new('test_averages.xls');

and this, of course, writes the file in the cgi-bin where the script is. But when I change the file name to something like this:

Code
'../../ha/test_average.pl'


The script generates an error.

I could not find any documentation explaining this on CPAN. It looks like something simple but I cant seem to hit on it.

Any help as always is welcome and appreciated.


(This post was edited by demon01 on Jun 18, 2009, 12:15 PM)


KevinR
Veteran


Jun 18, 2009, 12:16 PM

Post #2 of 5 (1816 views)
Re: [demon01] spreadsaheet::excel question [In reply to] Can't Post

Don't use ../../ if you can help it. Use a full path starting from the your servers root directory, whatever that is:

user/you/somefolder/file.xls

Ask your host what the root path is if you don't know.
-------------------------------------------------


demon01
Novice

Jun 18, 2009, 12:44 PM

Post #3 of 5 (1816 views)
Re: [demon01] spreadsaheet::excel question [In reply to] Can't Post

Well as it turns our I was able to do it using a variable:

Code
my $file="[./../ha/test_averages.xls]";


Then using it in the call.

Code
 my $workbook = Spreadsheet::WriteExcel->new($file);


This the excel document in its nice little folder.

Thanks and sorry for posting prematurely.


demon01
Novice

Jun 18, 2009, 12:48 PM

Post #4 of 5 (1815 views)
Re: [KevinR] spreadsaheet::excel question [In reply to] Can't Post

You're right Kevin, I am going to substitute it to the full path but I do have to assign it to a variable then insert it into the call without using the single quote.

I had tried it using the full path in the actual call but with the ' ' it would generate an error. Now in a scalar it seems to work as I need it to.

Thanks for your help as always


KevinR
Veteran


Jun 18, 2009, 3:36 PM

Post #5 of 5 (1811 views)
Re: [demon01] spreadsaheet::excel question [In reply to] Can't Post

More than likely the problem is that the new() method expects a reference of some sort, probably a reference to an array of options.

But you example makes no sense because you have quoted a reference which means its just a string.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives