perl-unicode

Re: Unicode aware module

1999-06-11 15:45:55
Gurusamy Sarathy writes:
Think of a custom mychomp() subroutine that you may want to write
that returns the result rather than the number of chopped characters.
How will you write it so that it behaves as expected when the caller
is in utf8 mode?

I agree that there's a need to be able to discover more a callers
context. (Including the hints value in the output of caller seems like
one obvious approach.)

Here's an implementation of that excellent idea.

Thanks, this is what I was advocating for many years.

+=item caller
+
+Allows modules to inherit pragmatic attributes from the caller's
+context.  C<utf8> is currently the only supported attribute.

locale should be supported too.  And can you put

  use caller 'attribute'

at the top of the module?

Anyway, one should be able to make

  use caller 'utf8 locale';

the default, as in

  use globalcaller 'utf8 locale';

with modules able to switch it off by

  use nocaller 'utf8 locale';

Ilya

<Prev in Thread] Current Thread [Next in Thread>