Skip to content

Instantly share code, notes, and snippets.

@haarg haarg/nopaste
Created Apr 2, 2019

Embed
What would you like to do?
diff --git i/lib/File/Slurp.pm w/lib/File/Slurp.pm
index 26e327b..8e977bb 100644
--- i/lib/File/Slurp.pm
+++ w/lib/File/Slurp.pm
@@ -86,7 +86,7 @@ sub read_file {
}
else {
# to keep with the old ways, read in :raw by default
- unless (open $fh, "<:raw", $file_name) {
+ unless (open $fh, "<", $file_name) {
@_ = ($opts, "read_file '$file_name' - open: $!");
goto &_error;
}
@@ -118,9 +118,6 @@ sub read_file {
}
seek($fh, $opts->{_data_tell}, SEEK_SET) if $opts->{_is_data} && $opts->{_data_tell};
- # line endings if we're on Windows
- ${$buf_ref} =~ s/\015\012/\012/g if $is_win32 && !$opts->{binmode};
-
# we now have a buffer filled with the file content. Figure out how to
# return it to the user
my $want_array = wantarray; # let's only ask for this once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.