Skip to content

use of FindBin is DISCOURAGED for good reason ... #18

Open
@drrrho

Description

@drrrho

According to

https://perldoc.perl.org/FindBin#KNOWN-ISSUES

"Which also means that you should avoid using FindBin in modules that you plan to put on CPAN. "

One - of the many problems - is that if an application renames the process with

$0 = "my new name"

then BEGIN around FindBin will use this new name when searching for the original "script". This will produce
a very ugly error message:

<<< returned exception: 'Cannot find current script 'mappo0' at /usr/share/perl/5.32/FindBin.pm line 166.
BEGIN failed--compilation aborted at /usr/share/perl/5.32/FindBin.pm line 166.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.32/JSON/JQ.pm line 11.
BEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.32/JSON/JQ.pm line 11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions