Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Need help in translating the following php code to perl

by davido (Cardinal)
on Oct 29, 2013 at 22:49 UTC ( [id://1060234]=note: print w/replies, xml ) Need Help??


in reply to Need help in translating the following php code to perl

Use the CGI module if you're doing CGI with Perl. It provides a header() method, and a param() method, which mostly work as you expect. Read the POD for details. It's been years since I last messed around with plain old CGI, and I don't even have a CGI-enabled environment configured at the moment that I can use for testing.

use CGI; my $q = CGI->new; print $q->header( -type => 'application/vnd.ms-excel', -Content-disposition => 'attachment; filename=BOBreports.xls', -pragma => 'no-cache', -expires => 'now', ); print $q->param('hiddenExportText'), "\n";

The header method conveniently passes through parameters that it doesn't know what to do with. For example, '-pragma' becomes 'Pragma: '

For the brave new world in web work, see Mojolicious or Mojolicious::Lite, or Dancer.


Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1060234]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-03-28 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found