From: Graham Knop Date: Tue, 8 Jan 2013 19:02:21 +0000 (+0000) Subject: fix packed script to work on perl 5.6 X-Git-Tag: v0.009012~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7bf1d4f2df5bc965471419258e2242557604ab6f;p=p5sagit%2FApp-FatPacker.git fix packed script to work on perl 5.6 --- diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index ced6545..bd36684 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -210,6 +210,14 @@ sub script_command_file { unshift @INC, sub { if (my $fat = $fatpacked{$_[1]}) { + if ($] < 5.008) { + return sub { + return 0 unless length $fat; + $text =~ s/^([^\n]*\n?)//; + $_ = $1; + return 1; + }; + } open my $fh, '<', \$fat or die "FatPacker error loading $_[1] (could be a perl installation issue?)"; return $fh;