perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Kalu┼ża <>
Subject Re: mod_perl and $0
Date Mon, 15 Apr 2013 06:12:08 GMT
On 04/12/2013 09:15 AM, Michiel Beijen wrote:
> Hi,
> According to perldoc perlvar the special variable $0 "Contains the
> name of the program being executed".
> My application uses $0 and FindBin to add some relative subdirectories
> to @INC. This works fine in CGI context, and when scripts are run from
> the command line, but under mod_perl $0 actually contains the Apache
> configuration file, so this does not work correctly. We fix this by
> performing 'use lib' with the actual directory names in the apache
> perl startup file.
> Now Fedora (Jan Kaluza) added a patch to their mod_perl package to set
> $0 to 'httpd' which is done I think in order to have a nice process
> list:

This was done mainly to fix , but as you stated 
below, during my work on porting mod_perl to httpd24, I have found out 
the same thing as you and currently in F18+ this patch is not applied:

> The problem with that is that it is no longer a valid path, so if we
> use FindBin it dies.
> I now worked around it by determining if $0 is a valid path and if not
> by assigning to it in a BEGIN block. Now mod_perl can at least start
> again on Fedora.
> Two questions:
> A: is it conceivable that we fix mod_perl so that it actually returns
> the correct value for $0?
> B: is the downstream patch Fedora uses for setting $0 to 'httpd' dersirable?
> --
> Mike

Jan Kaluza

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

View raw message