in reply to Re: How to use variables from other package?
in thread How to use variables from other package?
Wouldn't it be enough to just do the following:
Package:
package Foo; use vars qw( $foo ); $foo = 3;
Script:
use Foo; print $Foo::foo;
It works for me. But is there something wrong with this method? Apart from the fact, that I have to explicity call $foo with the package name.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: How to use variables from other package?
by integral (Hermit) on Apr 27, 2003 at 17:34 UTC | |
by chromatic (Archbishop) on Apr 27, 2003 at 19:55 UTC | |
by integral (Hermit) on Apr 27, 2003 at 20:01 UTC |