perl-unicode

Re: BOM and principle of least surprise

2004-05-06 10:30:17
On Wed, May 05, 2004 at 01:13:25PM -0500, Bob Maccione wrote:
: I'm surprised that we don't make the old functionality controlled by a
: variable of some sort.
: 
: i.e.
: 
: $UNICODE_ENABLED = 0;
: 
: shortcut:   $:-( = 0;
: 
: where the default is 1.   much like:  $/   
: 
: (hmm, I like the multibyte smilely convention, that would be
: interesting)

The problem with using a variable is that it potentially creates
magical action at a distance.  If we did have a variable API, it
would be limited to the compilation state, such that it would have
only a lexically-scoped effect on the defaults it controls, without
clobbering other modules.  (Much like we eventually did with $[ in
Perl 5, and for the same reasons.)  So it much more likely that the
interface would be something resembling "use bytes".

: of course it will require a visit to existing functionality but it does
: help the forward migration.

Depending on how you define those terms it's possible I might agree.

: btw: I do agree that there are times when a single byte output is
: required.  for example when parsing/building legacy data files. 

Well, certainly.  I don't think anyone here would dispute that.  The
question is what should be the default when, and how to best go about
evolving things when the appropriate default changes over time.  That's
what I was trying to say in my previous message, albeit more verbosely.

Larry

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