bin/cpanp-run-perl
raw| 1 | #!perl |
| 2 | use strict; |
| 3 | BEGIN { |
| 4 | my $old = select STDERR; $|++; # turn on autoflush |
| 5 | select $old; $|++; # turn on autoflush |
| 6 | $0 = shift(@ARGV); # rename the script |
| 7 | my $rv = do($0); # execute the file |
| 8 | die $@ if $@; # die on parse/execute error |
| 9 | } |
| 10 | ### XXX 'do' returns last statement evaluated, which may be |
| 11 | ### undef as well. So don't die in that case. |
| 12 | #die $! if not defined $rv; # die on execute error |