Skip Menu |
 

This queue is for tickets about the File-Slurper CPAN distribution.

Report information
The Basics
Id: 116738
Status: resolved
Priority: 0/
Queue: File-Slurper

People
Owner: Nobody in particular
Requestors: gortan [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.008
Fixed in: 0.009



Subject: read_text has strange side effect
Now this is weird: We recently replaced File::Slurp with File::Slurper, and have since seen strange behaviour in code that is nowhere related to the slurping or the slurped content. This gist demonstrates the side effect: <https://gist.github.com/mephinet/44bf611fee31f15c6811514497b12a7b> In test.pl, read_text is called with encoding cp1252. Afterwards, a constant string is written to a file, using utf-8 encoding. Please note that the result of read_text is completely ignored. What happens is this: Use of uninitialized value in subroutine entry at ./test.pl line 11. Close with partial character at ./test.pl line 11. Use of uninitialized value in subroutine entry at ./test.pl line 11. Close with partial character at ./test.pl line 11. Use of uninitialized value in subroutine entry at ./test.pl line 11. When you comment out the call to read_text, the warnings disappear. Seen on Gentoo Linux, RHEL5 and RHEL6 with Perl 5.20.2. PerlIO::utf8_strict is available on all the machines (and maybe it's the one to blame?).
Download (untitled) / with headers
text/plain 120b
#127149 is to blame - localizing $PerlIO::encoding::fallback without $PerlIO::encoding being loaded triggers this bug.
Download (untitled) / with headers
text/plain 200b
On Fri Aug 05 11:34:23 2016, GORTAN wrote: Show quoted text
> #127149 is to blame - localizing $PerlIO::encoding::fallback without
oh, it's in Perl's RT, thus: https://rt.perl.org/Public/Bug/Display.html?id=127149


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.