in reply to A case for enviromental conservation?

Just ugly in my opinion, not awful. If you're going to use a global variable to store your user object then you might as well make your own instead of using %ENV.

You don't mention using the object across HTTP calls, which is good because as grinder wrote, it wouldn't work anyway.

A module can access a variable in the main script/cgi file by using the $::variable_name notation, or you can fully qualify the name with $MAIN::variable_name. I like better to have a user object and pass it along to functions or to have the user object methods call the other modules functions/methods. Whatever rocks your boat, but leave %ENV alone if you can.

tstock
  • Comment on Re: A case for enviromental conservation?

Replies are listed 'Best First'.
Re: Re: A case for enviromental conservation?
by caedes (Pilgrim) on Jun 17, 2002 at 00:59 UTC
    Thanks for the note, I wasn't aware of the $::variable notation. A nice short global variable is basically all I was looking for, and %ENV was just sitting right there.

    The user object idea also sounds good, although I fear that it would prove too syntactically verbose for my taste.