In re the discussion of $^O, etc, etc, I'd like to throw out
some ideas on these line noise features and (for lack of a better
name) perl control values.

IMHO there are two distinct sets of problems here.  One is that
the existing $[linenoise] vars are horrible names and really need
some syntactic sugar.  `use English' is a help, but it's limited
and requires Yet Another Module be loaded when you compile.   The
other set is that some vars are:

   o  useless
   o  unused (as far as we know)
   o  duplicated by other features
   o  standing in the way of advance because of backwards compatibility
   o  hard to deprecate without nagging the crap out of users running
      the programs

I'd prefer that we break these vars out into a set of hashes with
appropriate names:

  $PERL_CORE{warnings}          vs      $^W
  $PERL_CORE{version}           vs      $^V
  $PERL_FORMATS{name}           vs      $^
  $PERL_FORMATS{lines_left}     vs      $-

These ought to be `protected' in the sense that one could change
the value of an entry, but not remove/add an entry to these hashes.
The result in some sense this mimics what `use English' does, but
gives us some additional wins:

  o  no need for Yet Another Module to be loaded
  o  it promotes code readability
  o  probably promotes core Perl maintainability
  o  should we move formats (or any similar current core functionality)
     to a loadable module, this neatly encapsulates all the data with
     a single referenced name (this idea shamelessly ripped off from
     common TCL usage)
  o  solves problems with $<linenoise> variable proliferation
  o  promotes introspection - its easy to determine what's possible in
     a given `module' via ``foreach $key ( %PERL_CTL )''.  Then you can
     just look them up in the manual.  :-)
 
`use strict foo' should set $PERL_STRICT{foo}, etc.  Then we dynamicly
manipulate it by manipulating the hash, not by sprinkling `use strict'
lines around the place.

For deprecation, we should have a %PERL_DEPRECATED{mod}{thing} hash as
well.  `mod' is `CORE', `FORMATS', etc, as above.  A value of 0 means the
function is actually gone, 1 means it's disappearing next major release,
2 mean next minor, etc.  The programmer can control what happens when
the feature is used by setting a %PERL_DEPRECATED{mod}{warning} value
to 0 for default, 1 for once, 2 for never, etc, etc.

Reply via email to