perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Jagdmann <>
Subject Re: Dynamically generating file for download
Date Tue, 31 Jul 2007 09:25:46 GMT
Hello Lelton,

I usually do it the same way as Ed suggested. Use a different file 
extension for Embperl pages and pure perl pages. Here's an exerpt from 
my apache.conf:

Options +ExecCGI
AddHandler cgi-script .pl
<FilesMatch ".*\.html$">
   SetHandler  perl-script
   PerlHandler HTML::EmbperlObject

So .html files are handles by Embperl and .pl files are just plainly 
called. If performance would be important for this website I could have 
used the mod_perl registry for the .pl files.

The form (in your Embperl code) then looks like:

<form action="">
  <input name="whatever"/>

And my stub for

#!/usr/bin/env perl
use CGI;
my $cgi=new CGI;
my $whatever=$cgi->param('whatever');
my $c=magic_function_to_generate_content_into_scalar($whatever);
print "Content-Type: image/png\n\n";
print $c;
exit 0;

---> Dirk Jagdmann ^ doj / cubic

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message