Commits

Shlomi Fish committed 9a143b5

Convert to IO::All .

  • Participants
  • Parent commits be48bf8

Comments (0)

Files changed (1)

installer/perl5/Shlomif/Quad/Pres.pm

 
 use parent (qw( Shlomif::Gamla::Object ));
 
+use IO::All;
+
 use Data::Dumper;
 
 use Shlomif::Quad::Pres::Url;
 
     my $filename = "./src/" . $document_id;
 
+    my $index_fn = $filename."/index.html";
+
     if (-f $filename)
     {
-        my $text;
-        local(*I);
-        open I, ("<".$filename);
-        $text = join("",<I>);
-        close(I);
-        return $text;
+        return scalar( io->file($filename)->slurp );
     }
-    elsif ((-d $filename) && (-f $filename."/index.html"))
+    elsif ((-d $filename) && (-f $index_fn))
     {
-        my $text;
-        local(*I);
-        open I, ("<".$filename."/index.html");
-        $text = join("",<I>);
-        close(I);
-        return $text;
+        return scalar( io->file($index_fn)->slurp );
     }
     else
     {