RE: FindBin/Apache::Registry bug (fwd)

1999-12-10 Thread Stas Bekman

 A possible workaround is to mess with %INC:
 
 delete $INC{FindBin};
 use FindBin;

Of course, as Eric corrected me, it should be 'require()' instead of
'use()', since use is done at compile time. do() is another option.

But require() wouldn't import tags, so ether use FQ variable $FindBin::Bin
or use:

  import FindBin;

if you need to import them.



Re: FindBin/Apache::Registry bug

1999-12-09 Thread Andrei A. Voropaev

Don't use FindBin. It's not compatible with mod_perl since it uses
BEGIN block which is executed only ones and for correct work it should
be executed every time when the request comes.

Andrei

On Thu, Dec 09, 1999 at 12:03:56PM -0800, Joao Fonseca wrote:
 This message was sent from Geocrawler.com by "Joao Fonseca" 
[EMAIL PROTECTED]
 Be sure to reply to that address.
 
 Hello,
 
 I'm having problems migrating a site to mod_perl,
 using the Apache::Registry module.
 Scenario:
 
 -I have 2 CGIs (cgi1 and cgi2).
 -CGI1 is a soft link, and uses FindBin:
 use FindBin;
 use lib "$FindBin::RealBin";
 use MyLib;
 
 -CGI2 is not a soft link and also uses FindBin;
 
 After running several times, CGI1 sometimes fails
 with:
 Can't locate MyTag.pm in @INC...
 
 After debugging, I found out that FindBin thinks
 it's running
 CGI2 instead of CGI1, and the use lib statement
 doesn't go
 to the proper location.
 
 Here's my theory:
 
 -On a previous request, CGI2 was run, and used
 FindBin.
   FindBin recorded all it's info for CGI2
 (RealBin, Bin, Script,
   and RealScript).
 
 -Later, a request for CGI1 came, which also tried
 to use
  FindBin.
 
 -Apache::Registry doesn't load the FindBin module
 again.
   Instead, uses the cached version from the
 previous request.
   FindBin doesn't  refresh the RealBin variable,
 and the
   use lib statement now points to the CGI2
 directory.
 
 -Of course, MyLib isn't found in @INC, because
 it's pointing
   to the wrong directory!
 
 
 Any thoughts on how to overcome this problem? I
 want to
 keep a soft link on CGI1.
 
 Thanks,
 Joao Fonseca
 
 
 
 Geocrawler.com - The Knowledge Archive

-- 



Re: FindBin/Apache::Registry bug

1999-12-09 Thread Tom Mornini

On Thu, 9 Dec 1999, Joao Fonseca wrote:

 I'm having problems migrating a site to mod_perl,
 using the Apache::Registry module.

Try Apache::PerlRun instead. It's better for quick ports of old CGIs.

-- 
-- Tom Mornini
-- InfoMania Printing and Prepress