We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I really don't think using globals will come back to haunt you in "mysterious and underhanded ways". You can safely use them, even in large projects. It's just that often in large projects they are more cumbersome and problematic to deal with.
In your case it really comes down to what you think this program will look like a few years from now. If you think it will be about the same size, etc. then I would continue with what you have. If you think there is a good chance it will turn into a much larger and much more complex program then avoiding globals would likely be a better choice. Also, if you do not have a lot of OO experience then you should consider how that will delay your project and how likely you will introduce different types of issues due to that lack of experience. I guess what I am trying to say is that you should avoid using globals for sound technical reasons instead of fear and cargo cult culture. Note: I assume by "global" you mean variables declared in the main:: scope (as opposed to e.g. "our" variables). Elda Taluta; Sarks Sark; Ark Arks In reply to Re: Are global variables "bad"?
by Argel
|
|