Jason Corbett wrote:
Can someone tell me if there is an official way to define a global
variable?

use vars qw($global1 $global2);

or

    our ($global1, $global2);

The latter cannot be used in Perl versions previous than 5.6.0. Note that the two methods do not do exactly the same thing; see the docs:

    perldoc vars
    perldoc -f our

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to