develooper Front page | perl.perl5.porters | Postings from May 2012

Re: [perl #63476] Cannot find current script '/dev/null' at/usr/share/perl/5.10/FindBin.pm line 206

Thread Previous
From:
Eric Brine
Date:
May 3, 2012 00:32
Subject:
Re: [perl #63476] Cannot find current script '/dev/null' at/usr/share/perl/5.10/FindBin.pm line 206
Message ID:
CALJW-qGwT5eBaRL4+7bOzBXFoxb228ZUhcx3A3cGPSkxBJ1UvA@mail.gmail.com
On Tue, May 1, 2012 at 9:52 PM, James E Keenan via RT <
perlbug-followup@perl.org> wrote:

> Discussion in this thread petered out three years ago.  Jesse seems to
> be saying that this is not a bug in FindBin.  Should we keep this ticket
> open?
>

ModPerl::Registry does set $0, so FindBin should work fine from registry
scripts (though you'll need to call C<< FindBin::again() >> as per the
documentation).

I presume this problem occurs if he tries to load FindBin from the startup
script or equivalent, in which case it falls to mod_perl to provide
something useful in $0.

Even if I'm missing something, I don't see how this can possibly be a
problem with FindBin.

Closing this ticket.

- Eric

Mod::PerlRegistry's wrapper:

    my $eval = join '',
                    'package ',
                    $self->{PACKAGE}, ";",
                    "sub handler {",
                    "local \$0 = '$script_name';",
                    $nph,
                    $shebang,
                    $line,
                    ${ $self->{CODE} },
                    "\n}"; # last line comment without newline?


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About