Commits

Anonymous committed 13a0dc3

Converted away from File::Slurp.

Comments (0)

Files changed (3)

CPANPLUS-Dist-Fedora/Build.PL

         'CPANPLUS::Error'      => 0,
         'File::Basename'       => 0,
         'File::Copy'           => 0,
-        'File::Slurp'          => 0,
         'IPC::Cmd'             => 0,
         'Pod::POM'             => 0,
         'Pod::POM::View::Text' => 0,

CPANPLUS-Dist-Fedora/Changes

         - http://nntp.x.perl.org/group/perl.cpan.testers/2202219
  - Eliminated the rest of the Readonly variables and converted them to
  object methods.
+ - Eliminated the use of File::Slurp and made the file slurp a line-wise loop,
+ that should consume less memory.
  
 0.0.2 TODO: FILL IN.
  - Applied a modified version of Chris Weyl's patch to 

CPANPLUS-Dist-Fedora/lib/CPANPLUS/Dist/Fedora.pm

 use CPANPLUS::Error; # imported subs: error(), msg()
 use File::Basename;
 use File::Copy      qw[ copy ];
-use File::Slurp     qw[ slurp ];
 use IPC::Cmd        qw[ run can_run ];
 use List::Util      qw[ first ];
 use Pod::POM;
 sub _is_module_build_compat {
     my ($module) = @_;
     my $makefile = $module->_status->extract . '/Makefile.PL';
-    my $content  = slurp($makefile);
-    return $content =~ /Module::Build::Compat/;
+
+    open my $mk_fh, "<", $makefile;
+
+    my $found = 0;
+
+    LINES:
+    while (my $line = <$mk_fh>)
+    {
+        if ($line =~ /Module::Build::Compat/)
+        {
+            $found = 1;
+            last LINES;
+        }
+    }
+
+    close($mk_fh);
+
+    return $found;
 }