still requires perl 5.8; 5.6 only works for the fatpacked scripts, not the fatpacking...
[p5sagit/App-FatPacker.git] / lib / App / FatPacker.pm
index 03d28fb..62411b9 100644 (file)
@@ -14,7 +14,7 @@ use File::Copy qw(copy);
 use File::Path qw(mkpath rmtree);
 use B qw(perlstring);
 
-our $VERSION = '0.009009'; # 0.9.9
+our $VERSION = '0.009012'; # 0.9.012
 
 $VERSION = eval $VERSION;
 
@@ -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;