App-ChangeShebang
view release on metacpan or search on metacpan
- 0.04 is broken; miss EXE_FILES attribute in Makefile.PL, fix that.
0.04 2015-05-10T06:24:57Z
- remove unnecessary "--" for exec perl
- remove original shebang as well as "not running under some shell" stuff
0.03 2014-07-06T05:34:18Z
- to make sure rename() properly works, make a tempfile in the same directory
0.02 2014-07-05T16:44:54Z
- fix documentation
0.01 2014-07-05T16:01:03Z
- original version
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or
an equivalent medium, or placing the modifications on a major archive
site such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided, and provide
a separate manual page for each non-standard executable that clearly
documents how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
lib/App/ChangeShebang.pm view on Meta::CPAN
my ($tmp_fh, $tmp_name) = File::Temp::tempfile UNLINK => 0, DIR => File::Basename::dirname($file);
chmod $mode, $tmp_name;
print {$tmp_fh} <<'...';
#!/bin/sh
exec "$(dirname "$0")"/perl -x "$0" "$@"
#!perl
...
print {$tmp_fh} $content;
close $tmp_fh;
rename $tmp_name, $file or die "rename $tmp_name, $file: $!\n";
}
1;
__END__
=encoding utf-8
=head1 NAME
App::ChangeShebang - change shebang lines for relocatable perl
( run in 1.415 second using v1.01-cache-2.11-cpan-0fb53d1c279 )