Front page | perl.perl5.porters |
Postings from March 2021
From: Felipe Gasper
March 3, 2021 01:44
Message ID: 49D58289-92B5-4389-8FAC-C96BA971B2F5@felipegasper.com
I pushed a CPAN module today, Sys::Binmode, that auto-downgrades strings on their way to the OS in ops like exec and require. This works around the use of SvPV_nolen to convert SVs to C strings, achieving predictable output without requiring the Perl application to violate Perl’s internal string-encoding abstraction.
While in Linux this makes total sense, someone pointed out that in Windows things are more complicated. Sys::Binmode doesn’t break anything in Windows Perl currently, but it apparently *would* break things if Windows Perl switched to functions like CreateDirectoryW rather than CreateDirectoryA, since then we’re not passing byte strings to the OS anymore.
Now I wonder: which other OSes does Perl support that present such problems?
by Felipe Gasper