App::ChangeShebang - change shebang lines for relocatable perl
> change-shebang /path/to/bin/script.pl > head -3 /path/to/bin/script.pl #!/bin/sh exec "$(dirname "$0")"/perl -x "$0" "$@" #!perl
change-shebang changes shebang lines from
#!/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 (-Duserelocatableinc). Then the shebang lines of executable scripts point at the installation time perl binary path.
-Duserelocatableinc
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
which means that scripts will be executed by the perl located in the same directory.
Shoichi Kaji <skaji@cpan.org>
Copyright 2018 Shoichi Kaji <skaji@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install App::ChangeShebang, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::ChangeShebang
CPAN shell
perl -MCPAN -e shell install App::ChangeShebang
For more information on module installation, please visit the detailed CPAN module installation guide.