in reply to Re: Re: Re: Usage of our
in thread Usage of our
My module MyPack.pm can be either:use strict; use MyPack; my $myString = $MyPack::a; print $myString;
orpackage MyPack; require Exporter; $a = "Read from Mypack"
The program tempo2.pl runs properly regardless of whether I use Exporter or 'our'. So my question is, when would one prefer the use of 'our' instead of Exporter?package MyPack; our $a = "Read from Mypack"
Is the use of 'our' in order to avoid possibly polluting a namespace by exporting all of the package variables?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Usage of our
by Masem (Monsignor) on May 21, 2001 at 20:27 UTC | |
by sierrathedog04 (Hermit) on May 21, 2001 at 20:43 UTC | |
by danger (Priest) on May 21, 2001 at 22:06 UTC | |
by sierrathedog04 (Hermit) on May 21, 2001 at 22:53 UTC | |
by danger (Priest) on May 21, 2001 at 23:22 UTC |