develooper Front page | perl.perl5.porters | Postings from March 2021

Re: Perl 7: Fix string leaks?

Thread Previous
Dan Book
March 29, 2021 00:21
Re: Perl 7: Fix string leaks?
Message ID:
On Sun, Mar 28, 2021 at 8:13 PM Yuki Kimoto <> wrote:

> Does this mean that mkdir can be allowed to pass a string that has UTF8
> flag?
> Currently, I think that the correct behavior of Perl5 is that the bytes
> are passed to mkdir.
> For example, bytes means cp932 in windows, or UTF-8 in Mac or Linux/UNIX.

The problem is that the internal Perl storage of the string is passed,
which may or may not be the bytes you see in Perl (e.g. using length(), eq,
regex, other string operations) depending on operations that Perl users
should not care about. So you cannot be certain that the bytes you intended
to pass will be used. Further explained in Felipe's recent blog post:


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About