Skip to content

Commit

Permalink
use the same slurp idiom everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 21, 2015
1 parent ec7920e commit 9ac2e10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/Util.pm
Expand Up @@ -233,8 +233,8 @@ sub sha1_sum { sha1_hex @_ }

sub slurp {
my $path = shift;
open my $file, '<:unix', $path or croak qq{Can't open file "$path": $!};
defined read $file, my $content, -s $file, 0
open my $file, '<', $path or croak qq{Can't open file "$path": $!};
defined $file->sysread(my $content, -s $file, 0)
or croak qq{Can't read from file "$path": $!};
return $content;
}
Expand Down

0 comments on commit 9ac2e10

Please sign in to comment.