Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I always used $0 to display my Perl program's status on the command-line which is incredibly useful for debugging. Today, our hosting provider upgraded our server (Linux Redhat, perl, v5.8.0 built for i686-linux) and now the $0 assignment is not reflected in the 'ps' output anymore.

Is this a kernel issue and can I enable this again since I cannot live without! If not, how come some processes still do it (e.g. crond, xinetd)?

TIA!

Replies are listed 'Best First'.
Re: Enable $0 process name
by Somni (Friar) on May 24, 2004 at 13:07 UTC

    This is a bug in perl 5.8.0, fixed in 5.8.1.

    The bug report is mentioned in fully six seperate tickets. This ticket provides additional detail regarding limitations and issues.

    You can either upgrade (preferred, given 5.8.0 is nearly two years old), or apply a patch. This ticket mentions a patch, but it is incorrect. Jarkko Hietaniemi follows up in the ensuing discussion with instructions about obtaining a working one.

      Thanks for the links, you've been very helpful. I will try to convince my ISP to upgrade to perl 5.8.1

      Regards, Marcel
Re: Enable $0 process name
by DrHyde (Prior) on May 24, 2004 at 13:02 UTC
    You will find proper logging far more useful for debuggering.