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