Think about Loose Coupling | |
PerlMonks |
Re: 2 questions about anonymous storage and global variablesby Enlil (Parson) |
on Jan 13, 2006 at 01:04 UTC ( [id://522853]=note: print w/replies, xml ) | Need Help?? |
Firstly I have a scalar that will contain either a value or a reference to an array. If it's an array I want it to do one thing. If it's a scalar value I want it to do another. What's the correct way of doing this so I don't get errors? Have a look at ref in the documentation. It has a couple of examples of what you are looking for. Secondly How can a make a global variable truely global, so that it will be accessible by all packages without using package::variable. You don't. Well sortof, Can you create *real* global variables? hth
In Section
Seekers of Perl Wisdom
|
|