in reply to Re: Note on usage of ours variables and a question
in thread Note on usage of ours variables and a question
Variables written ... with a "^" sign and in braces ... are automatically global and available everywhere in your program, without needing to be declared.
So is any fully-qualified package-global (even under strictures):
c:\@Work\Perl\monks>perl -wMstrict -le "{ package Foo; $::bar = 'Baz'; sub p_bar { print $::bar; } } ;; Foo::p_bar; ;; { package Fiz; sub new_bar { $::bar = 'Boff'; } } Fiz::new_bar; Foo::p_bar; ;; $::bar = 'Quux'; print $::bar; " Baz Boff Quux
Give a man a fish: <%-{-{-{-<
|
|---|