Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: A case for enviromental conservation?

by tstock (Curate)
on Jun 16, 2002 at 23:29 UTC ( [id://174992]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://174992]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-24 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found