
jkaluza at redhat
Apr 14, 2013, 11:12 PM
Post #1 of 2
(170 views)
Permalink
|
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: > > http://pkgs.fedoraproject.org/cgit/mod_perl.git/commit/mod_perl-short-name.patch?id=e18c20f9e3cdc3e062f75e8d54fdd4520d2f719f This was done mainly to fix https://bugzilla.redhat.com/show_bug.cgi?id=782369 , 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: http://pkgs.fedoraproject.org/cgit/mod_perl.git/tree/mod_perl.spec#n81 > 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: dev-unsubscribe [at] perl For additional commands, e-mail: dev-help [at] perl
|