This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PerlIO::get_layers: Treat numbers as strings
authorFather Chrysostomos <sprout@cpan.org>
Sun, 25 Dec 2011 08:16:21 +0000 (00:16 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 25 Dec 2011 08:16:21 +0000 (00:16 -0800)
commit3825652ddfd2e6e7a10980ece6f9a732388cbecf
tree97973ad16215f8ddf0bc57ef0bbae24567349241
parent7f9aa7d32945332aeb1251c905307d22abfd4da5
PerlIO::get_layers: Treat numbers as strings

PerlIO::get_layers should not be ignoring an argument like 12, but
treating "12" (the string) as a filehandle, as those are both the
same value.

It’s an instance of the string/num bug, which is a bit like the
Unicode Bug.

This commit takes the conservative approach of expanding it to flat
scalars in general, but not references (in case we decide to do
something interesting later on, even though I think that would be a
bad idea).
t/io/layers.t
universal.c