ePerl

There are two versions of ePerl:

The former is a C wrapper around a perl module. The latter is written entirely in perl.

I was using Ralf S. Engelschall's version until now, because it is in Debian repositories. However, I wanted to return an HTTP 500 code upon error, so that Google would't index errors (as it currently does). It is hard-coded in the C code. Rather than recompiling, I tried the newer version from MarginalHacks. The error code is hard-coded as well, but it is in Perl, so easier to rewrite and to link with my standard error code.

I had to modify my shebangs (#!/usr/bin/eperl.pl --mode=CGI is fine), and also to correct an error in eperl.pl by adding

@files = $ENV{"SCRIPT_FILENAME"};

inside the

if ($opt{'mode'} ne "f") {

block (that is, between lines 220 and 224), because we don't want to use the HTTP path passed as argument in CGI mode, but rather the script file name.

Unfortunately, I quickly noted that this new ePerl looses STDIN data. That means, no POST data available in the script: and I use that for comments and contact. There is a -t argument, but it had no effect for me. I'll stick to the old ePerl for the moment, and try to make sure my code runs fine, but I'll need to have a closer look into what happens exactly with input sooner or later.

Xavier Robin
Published Sunday, June 13, 2010 18:32 CEST
Permalink: /blog/2010/06/13/eperl
Tags: My website Programming
Comments: 0

Comments

No comment

New comment

* denotes a mandatory field.

By submitting your message, you accept to publish it under a CC BY-SA 3.0 license.

Some HTML tags are allowed: a[href, hreflang, title], br, em, i, strong, b, tt, samp, kbd, var, abbr[title], acronym[title], code, q[cite], sub, sup.

Passer en français

Search

Tags

Background noise Books Computers Fun Hobbies Internet Me Mozilla My website Photo Politics Programming School Software Ubuntu pROC

Recent posts

Calendar

MonTueWedThuFriSatSun
123456
78910111213
14151617181920
21222324252627
282930

Syndication

Recommend