Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Are global variables "bad"?

by DStaal (Chaplain)
on Apr 21, 2009 at 17:40 UTC ( [id://759069]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Are global variables "bad"?
in thread Are global variables "bad"?

Quick version on bless: It marks a reference as an object. The reference can be to any type of varible: scalar, array, hash, are all common. You will need to figure out some way of accessing the data you want to access as the object's data based on the contents of that variable.

Common strategies include: just putting it in the scalar (for simple data), or array/hash (for more complex); and putting a key into some other data structure into the variable (inside-out uses package-level hashes, with the key being the blessed variable's address. Some people like to use arrays, for faster access.).

Replies are listed 'Best First'.
Re^4: Are global variables "bad"?
by jpearl (Scribe) on Apr 21, 2009 at 18:41 UTC
    For some reason that's the first explanation that's made sense :-P I will definitely have to do some more homework before I get to crazy, but my fingers are itching for a few practice problems.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-18 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found