develooper Front page | perl.perl5.porters | Postings from November 2011

Re: RFC: Autoloading charnames

Thread Previous | Thread Next
H.Merijn Brand
November 23, 2011 01:38
Re: RFC: Autoloading charnames
Message ID:
On Tue, 22 Nov 2011 16:23:19 -0600, Jesse Luehrs <> wrote:

> > > If it is done, should the functions in the module also autoload.  That is,
> > > should a line like 'my $poo = charnames::viacode(0x1F4A9)' fail if charnames
> > > hasn't been 'used' or 'required' or should it cause the module to load ?  
> > 
> > I don't like general-purpose auto-loading.  However, I can see the
> > case for \N{} (just I saw the case for autoloading IO::File when
> > methods are called on filehandles.  If \N{} does load charnames, then
> > I would expect charnames::viacode(...) to work.  However, without
> > prior \N{} (assuming compile-time loading), I would expect
> > charnames::viacode() to be a compilation error.  
> I personally wouldn't expect the presence or absence of a \N{} escape at
> some arbitrary location in my code (possibly even in a different file)
> to make the difference (on its own) of whether calling functions in
> charnames:: worked or not. This seems like it would cause confusion.

I'd say lets make charnames behave at least like utf8:

$ perl -wlE'say utf8::is_utf8("\x{20ac}")'

See, no use and still available. If \N{} autoloads charnames (and I am
fully in favor), so should charnames::viacode

One more reason for doing so is that charnames cannot be backported and
is not available on CPAN. It is very tightly coupled to the current core

H.Merijn Brand      Perl Monger
using 5.00307 through 5.14 and porting perl5.15.x on HP-UX 10.20, 11.00,
11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.4 and AIX 5.2 and 5.3. 

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