in reply to Re: Packages and modules
in thread Packages and modules
my $foo = new Foo("bar"); package Foo; sub new { my $class = shift; my $var = shift; bless \$var, $class; }
---------(In Foo.pm)------------------ package Foo; sub import { $Foo::var = shift; } ---------(In a different file)-------- use Foo qw(bar); # Sets $Foo::var to "bar" #... $Foo::var = "baz"; # Changes $Foo::var to "baz"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Packages and modules
by bart (Canon) on Jan 10, 2003 at 03:10 UTC | |
|
Re: Packages and modules
by Anonymous Monk on Jan 09, 2003 at 20:45 UTC | |
by behroozi (Beadle) on Jan 09, 2003 at 22:13 UTC |