summaryrefslogtreecommitdiff
path: root/dist/Tie-File
diff options
context:
space:
mode:
authorRichard Leach <richardleach@users.noreply.github.com>2020-02-07 22:01:25 +0000
committerTodd Rinaldo <toddr@cpan.org>2020-02-10 21:53:00 -0600
commitd34b46d077dcfc479c36f65b196086abd7941c76 (patch)
tree434d90e8b46b88471cf88abb654dd44491321d46 /dist/Tie-File
parent5926ffcd2cf97026fabb7ead7fc81676f9ad88a9 (diff)
downloadperl-d34b46d077dcfc479c36f65b196086abd7941c76.tar.gz
Tie::File - Document use of binmode on filehandles
Documentation fix for #17497, where the user passed a filehandle in, but the lack of binmode meant that the :crlf layer on Windows caused problems when the file was later used on Linux.
Diffstat (limited to 'dist/Tie-File')
-rw-r--r--dist/Tie-File/lib/Tie/File.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/dist/Tie-File/lib/Tie/File.pm b/dist/Tie-File/lib/Tie/File.pm
index b2ded8af3e..824789337b 100644
--- a/dist/Tie-File/lib/Tie/File.pm
+++ b/dist/Tie-File/lib/Tie/File.pm
@@ -2319,6 +2319,11 @@ internally. If you passed it a filehandle as above, you "own" the
filehandle, and are responsible for closing it after you have untied
the @array.
+Tie::File calls C<binmode> on filehandles that it opens internally,
+but not on filehandles passed in by the user. For consistency,
+especially if using the tied files cross-platform, you may wish to
+call C<binmode> on the filehandle prior to tying the file.
+
=head1 Deferred Writing
(This is an advanced feature. Skip this section on first reading.)