On 6/11/22 02:37, Neil Bowers wrote:
> > Can someone show an example, ideally on CPAN, where this gets used?
>
> I _think_ you were asking for an example of someone using the return
> value from a require. In which case:
>
> https://grep.metacpan.org/search?qci=&q=%3D%20require&qft=&qd=Acme-MetaSyntactic-Themes&f=lib%2FAcme%2FMetaSyntactic%2Funicode.pm
> <https://grep.metacpan.org/search?qci=&q=%3D%20require&qft=&qd=Acme-MetaSyntactic-Themes&f=lib%2FAcme%2FMetaSyntactic%2Funicode.pm>
>
> This is in BooK’s Acme::MetaSyntactic::unicode module (yeah, Acme):
>
> if ( $] >= 5.006 && $] < 5.007003 ) {
> eval { $data = require 'unicode/Name.pl'; };
> }
> elsif ( $] >= 5.007003 ) {
> eval { $data = require 'unicore/Name.pl'; };
>
> # since v5.11.3, unicore/Name.pl creates subroutines
> # they end up in our namespace, so get rid of them
> undef *code_point_to_name_special;
> undef *name_to_code_point_special;
> }
I feel compelled to point out that the file read-in in this example,
unicore/Name.pl, has the following text at its top
# !!!!!!! INTERNAL PERL USE ONLY !!!!!!!
# This file is for internal use by core Perl only. The format and even the
# name or existence of this file are subject to change without notice.
Don't
# use it directly. Use Unicode::UCD to access the Unicode character data
# base.
top of says:
> > Can someone show an example, ideally on CPAN, where this gets used?
>
> I _think_ you were asking for an example of someone using the return
> value from a require. In which case:
>
> https://grep.metacpan.org/search?qci=&q=%3D%20require&qft=&qd=Acme-MetaSyntactic-Themes&f=lib%2FAcme%2FMetaSyntactic%2Funicode.pm
> <https://grep.metacpan.org/search?qci=&q=%3D%20require&qft=&qd=Acme-MetaSyntactic-Themes&f=lib%2FAcme%2FMetaSyntactic%2Funicode.pm>
>
> This is in BooK’s Acme::MetaSyntactic::unicode module (yeah, Acme):
>
> if ( $] >= 5.006 && $] < 5.007003 ) {
> eval { $data = require 'unicode/Name.pl'; };
> }
> elsif ( $] >= 5.007003 ) {
> eval { $data = require 'unicore/Name.pl'; };
>
> # since v5.11.3, unicore/Name.pl creates subroutines
> # they end up in our namespace, so get rid of them
> undef *code_point_to_name_special;
> undef *name_to_code_point_special;
> }
I feel compelled to point out that the file read-in in this example,
unicore/Name.pl, has the following text at its top
# !!!!!!! INTERNAL PERL USE ONLY !!!!!!!
# This file is for internal use by core Perl only. The format and even the
# name or existence of this file are subject to change without notice.
Don't
# use it directly. Use Unicode::UCD to access the Unicode character data
# base.
top of says: