> That's the thing. It doesn't matter. It B<shouldn't> matter. Keep it
> pluggable; you could have everything in Latin1, in UTF8, in UTF16, or
> who knows what, but the core developer shouldn't have to care. One good
> way to achieve this is to have the string presented in the variable as
> an array of wchars or similar. The point is that it's the same for

Danger!  Only the implementer(s) of this pluggable data storage and
its interface should care about details like "an array of wchars".
All other people, even other core people, should use just the
interface, not do things like wcharp[n].

Also: I guess delaying the conversion as long as possible would be a
good thing, perfomance-wise?  That is, if I read in, say, Shift-JIS,
the data should stay in Shift-JIS as long as I don't modify it:

        if (open(OLDNIHONGO, "foo.old", ":sjis")) {
         if (open(NEWNIHONGO, "foo.new", ":sjis")) {
          while(<OLDNIHONGO>) {
           s/oldsjis/newsjis/; # (1)
           print NEWNIHONGO;   # (2)
          }
          close(NEWNIHONGO);
         }
         close(OLDNIHONGO);   
        }

Can we avoid in (1) converting the $_ into the whatever-internal form
as long as the substitution finds nothing to substitute?  If no changes
happen it would be silly to convert fom the native to the internal and
back again for output at (2).

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Reply via email to