develooper Front page | perl.par | Postings from November 2011

[rt.cpan.org #72082] $FindBin::Bin issue on Moudel::ScanDeps 1.04

Thread Previous | Thread Next
From:
Roderich Schupp via RT
Date:
November 1, 2011 15:11
Subject:
[rt.cpan.org #72082] $FindBin::Bin issue on Moudel::ScanDeps 1.04
Message ID:
rt-3.8.HEAD-2600-1320185470-1465.72082-15-0@rt.cpan.org
Tue Nov 01 18:11:09 2011: Request 72082 was acted upon.
Transaction: Correspondence added by RSCHUPP
       Queue: Module-ScanDeps
     Subject: $FindBin::Bin issue on Moudel::ScanDeps 1.04
   Broken in: (no value)
    Severity: (no value)
       Owner: RSCHUPP
  Requestors: mdengfeng@gmail.com
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=72082 >


OK, I see what's happening: 

When you call scandeps.pl with option
-c (or -x) it creates a temporary file that contains the text
of the file to scan plus some prologue code. This prologue code
will be called at the end of compilation (-c) or execution (-x)
and just dumps the contents of %INC, $INC etc. scandeps.pl runs
an inferior perl on this temporary file and reads back the information.

This temporary file used to be created in your working directory,
so if your script is also located there, FindBin for your script
and for the temp file would come to the same result.

In 1.04 I changed it so that the temp file is created in your
platform's temp directory. That explains why you see /tmp/lib
in @INC in the error message.

Can you try the attached patch? It makes FindBin return
the correct result by setting $0 to the path of your script.

Cheers, Roderich





Thread Previous | Thread Next


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