From bdb491a79d836beece65223777114f45e498b60c Mon Sep 17 00:00:00 2001 From: Christian Walde Date: Sat, 23 Apr 2016 18:18:39 +0200 Subject: [PATCH] ensure Document->save does not mangle newlines on windows --- lib/PPI/Document.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PPI/Document.pm b/lib/PPI/Document.pm index 20f2b053..dd3da2f3 100644 --- a/lib/PPI/Document.pm +++ b/lib/PPI/Document.pm @@ -346,6 +346,7 @@ sub save { my $self = shift; local *FILE; open( FILE, '>', $_[0] ) or return undef; + binmode FILE; print FILE $self->serialize or return undef; close FILE or return undef; return 1;