But that's the problem. A module has to do something to _protect_
itself. And trying to move the problem to the other party, the caller
can't know when it has to turn off utf8 before calling a routine. It
may not even know that a sensitive routine was called.
Isn't this why any pragma that changes _semantics_ are scoped?
Then there is the question of what is character oriented and what is
not. And will it change over the life of perl.
$foo = substring($exe, 32, 15); # Character or Byte?
<chaim>
"DH" == Dick Hardt <DickH(_at_)ActiveState(_dot_)com> writes:
DH> At 07:43 AM 4/21/99 , Chaim Frenkel wrote:
Why would this action at a distance _not_ break code.
parent turns on utf8
child attempts to process a binary string.
DH> If the child thinks of it as binary data, then it would not be doing any
DH> character oriented operations on it, hence it should not fail.
DH> If the child is using character oriented operations assuming it is working
DH> with an array of bytes, then it would need to save the state of the utf8
mode.
DH> my $utf8state = <<utf8_state_flag>>
DH> no utf8 if $utf8state;
DH> ... do work with character operators as though binary ...
DH> use utf8 if $utf8state;
DH> -- Dick
--
Chaim Frenkel Nonlinear Knowledge, Inc.
chaimf(_at_)pobox(_dot_)com
+1-718-236-0183