in reply to Re^2: Ugly ways to declare global variables?
in thread Ugly ways to declare global variables?
you are getting a "new variable out of it" that you can use.There's nothing new about the variable, and that is important. It might already have a value. When you actually declare a variable, it's really new. It's fresh and unused from that point. When you specify our, you gain only the ability to use the variable without its package specifier.
#!perl use strict; use warnings; $::z = 'bye'; our($z); print $z, " is ", $::z, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Ugly ways to declare global variables?
by tlm (Prior) on Apr 29, 2005 at 05:30 UTC | |
by Roy Johnson (Monsignor) on Apr 29, 2005 at 15:03 UTC |