Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Perl seems to mistreat "PerlIO" environment variable (Windows)

by vr (Curate)
on Apr 03, 2020 at 12:23 UTC ( [id://11114987]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl seems to mistreat "PerlIO" environment variable (Windows)
in thread Perl seems to mistreat "PerlIO" environment variable (Windows)

Is there any way you can avoid that environment variable being set and only use binmode?

Yes, sure, it's just that it's distribution of App::* variety, end-user targeted, like "no serviceable parts inside", etc. Of course I can fix it (and should notify the author). Thanks for reminding about crlf being "alternative buffering" and therefore operating on raw bytes:

open my $fh, '>', 'tmp.txt'; binmode $fh, ':encoding(UTF16)'; print $fh qq(\N{U+010A}\n); close $fh;

output is invalid on Windows (fe ff 01 0d 0a 00 0d 0a). Should have used ':raw:encoding(UTF16)'. Oh, as I see prepending ':raw' regardless is a good practice since long ago, should have paid closer attention to such details.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11114987]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found