cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More newbie questions...


From: Steven Knight
Subject: Re: More newbie questions...
Date: Wed, 25 Oct 2000 06:40:13 -0500 (CDT)

On Wed, 25 Oct 2000, Johan Holmberg wrote:
> > I'm obviously misunderstanding something about Export, as I'm getting odd
> > errors from cons.  I've been following the examples, and I'm getting errors
> > that I don't understand.
> > 
> > My Construct file has:
> > $ENV = new cons();
> > 
> [...]
> > 
> > When I run CONS, I get:
> > cons.bat: error in file "backend\Conscript" (cons.bat: variable "ENV"
> > exported b
> > ut not defined by file "Construct")
> > cons.bat: script errors encountered: construction aborted
> 
> The problem is that you use the name "ENV", that has a special
> meaing in Perl. If you change it to anything else it works better.
> 
> I posted a question about this more than a year ago, see:
> 
>   http://mail.gnu.org/pipermail/cons-discuss/1999-September/000638.html
> 
> I thought that this had been fixed somewhere between then and now,
> but obviously not. It should definitely be fixed.

I just did some digging, and it turns out this is a deeply embedded
Perlism.  From perlvar:

        Perl identifiers that begin with digits, control characters,
        or punctuation characters are exempt from the effects of the
        `package' declaration and are always forced to be in package
        `main'.  A few other names are also exempt:

                ENV             STDIN
                INC             STDOUT
                ARGV            STDERR
                ARGVOUT
                SIG

        In particular, the new special `${^_XYZ}' variables are always
        taken to be in package `main', regardless of any `package'
        declarations presently in scope.

So there isn't much we can do to fix this, so I'll check in a change to
the doc.  Sorry this wasn't taken care of sooner.

        --SK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]