App-ChangeShebang

 view release on metacpan or  search on metacpan

lib/App/ChangeShebang.pm  view on Meta::CPAN

    #!/path/to/bin/perl

to

    #!/bin/sh
    exec "$(dirname "$0")"/perl -x "$0" "$@"
    #!perl

Why do we need this?

Let's say you build perl with relocatable enabled (C<-Duserelocatableinc>).
Then the shebang lines of executable scripts point at
the installation time perl binary path.

So if you move your perl directory to other places,
the shebang lines of executable scripts point at a wrong perl binary and
we cannot execute scripts. Oops!

A solution of that problem is to replace shebang lines by

    #!/bin/sh



( run in 2.486 seconds using v1.01-cache-2.11-cpan-d7a12ab2c7f )