develooper Front page | perl.perl5.porters | Postings from December 2017

Perldoc does not mention effect of 'use utf8' on DATA section

Thread Next
From:
KES
Date:
December 22, 2017 17:31
Subject:
Perldoc does not mention effect of 'use utf8' on DATA section
Message ID:
1533611513963767@web6o.yandex.ru
Hi.

The question was: how data are read from DATA section if I have 'use utf8' in main file?

The [DOC](https://perldoc.perl.org/perldata.html#Special-Literals) states that:
>Text after __DATA__ may be read via the filehandle PACKNAME::DATA

But when I get access to file handle:
  my $handle = do { no strict 'refs'; \*{"${class}::DATA"} };

the DOC did non mention should I use 'binmode' or not:

  binmode $handle, ':utf8';


Please describe which layers are used for DATA section

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About