If by global var you mean package var, there's no such thing as declaring them. Perl will happily allow you to use any package var under any circumstance whether already used or not. Simplest thing you can tell for whether a package var is "there" or not, is check if it is defined or not.
Package global can be recognized by the fact that their name contains the package they belong to, eg $FirstPackage::packageVar or %SecondPackage::alsoAPackageVar. What may look like a package var without the package name are actually aliases with our. If you write our $var; inside the package MyPackage, you're just telling perl that $var actually means $MyPackage::var, but it won't change its value.
In reply to Re: how do i create a global var conditionally?
by Eily
in thread how do i create a global var conditionally?
by perltux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |