Do you know where your variables are? | |
PerlMonks |
Re: Example using CGI::Application::Plugin::Output::XSVby davebaker (Pilgrim) |
on May 05, 2020 at 02:53 UTC ( [id://11116469]=note: print w/replies, xml ) | Need Help?? |
Your code is a snippet that is designed to work as part of a CGI script that you'd put on a web server and run via a web browser. The CGI script would be written to work with a framework called CGI::Application. So to run your code you'll need to install CGI::Application and a module called CGI::Application::Plugin::Output::XSV -- both are available at metacpan.org Here's how I am able to get your snippet to work: First I create a file named index.cgi which I put into a directory named /www/cgi-bin/MyOutputXSV My perl executable (filename is perl) is in a directory called /opt; change the first line of the script to point to the installed perl executable file on your web server. Next I create a file named MyOutputXSV.pm and put it into that same directory: Next I change the Linux file permissions on index.cgi to be 705 (which lets my Apache web server read and execute the script) and then I run the script by entering https://mysitename.com/cgi-bin/MyOutputXSV/index.cgi into my web browser. The script then returns data as a binary file named download.csv, which my browser detects and uses to present a popup box to me that asks what program I'd like to use to open it. I have Excel on my Windows 10 PC so that's what I tell the browser. Then Excel opens and I see the data in a 3x3 set of cells:
In Section
Seekers of Perl Wisdom
|
|