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
Publié le dimanche 13 juin 2010 à 18:32 CEST
Lien permanent : /blog/2010/06/13/eperl
Tags : Mon site web Programmation
Commentaires : 0

Commentaires

Aucun commentaire

Nouveau commentaire

* L'astérisque dénote un champ obligatoire.

En soumettant votre message, vous acceptez qu' il soit publié sous licence CC BY-SA 3.0.

Quelques balises HTML sont autorisées : a[href, hreflang, title], br, em, i, strong, b, tt, samp, kbd, var, abbr[title], acronym[title], code, q[cite], sub, sup.

Switch to English

Chercher

Tags

Bruit de fond Hobbys Humour Informatique Internet Livres Logiciels Moi Mon site web Mozilla Photo Politique Programmation Scolaire Ubuntu pROC

Billets récents

Calendrier

lun.mar.mer.jeu.ven.sam.dim.
123456
78910111213
14151617181920
21222324252627
282930

Syndication

Recommender