RE: our vs. use vars

2003-10-29 Thread Dan Muey
variable); method > > > > So I was wanting some input about pros and cons of using > either since > > on the surface they appear to do the same thing except that > use vars > > is backwards compatable. > > > > Any input on our vs. use vars ?? Pro,c

Re: our vs. use vars

2003-10-29 Thread Darin McBride
g some input about pros and cons of using > either since on the surface they appear to do the same thing > except that use vars is backwards compatable. > > Any input on our vs. use vars ?? Pro,con, neutral ?? If you want your module to work with pre-5.6 perl, you don't have a choic

RE: our vs. use vars

2003-10-28 Thread Dan Muey
> On Tue, Oct 28, 2003 at 01:44:58PM -0600, Dan Muey wrote: > >> If you don't care about older perls (and 5.005_03 is getting > >> kind of mouldy) then do something like > >> > >> use 5.006; > >> > >> use base qw(Exporter); > > > > And that brings up another issue: > > what is the differ

Re: our vs. use vars

2003-10-28 Thread Steve Grazzini
On Tue, Oct 28, 2003 at 01:44:58PM -0600, Dan Muey wrote: >> If you don't care about older perls (and 5.005_03 is getting >> kind of mouldy) then do something like >> >> use 5.006; >> >> use base qw(Exporter); > > And that brings up another issue: > what is the difference between: >

RE: our vs. use vars

2003-10-28 Thread Dan Muey
> On Tue, Oct 28, 2003 at 12:14:05PM -0600, Dan Muey wrote: > > Hmm ok, what would be nice is to do something like this: > > (I have a function that returns true if the perl version is > the same > > or higher than the specified number) > > > > package Monkey; > > > > use strict; > > > > if(go

Re: our vs. use vars

2003-10-28 Thread Steve Grazzini
On Tue, Oct 28, 2003 at 12:14:05PM -0600, Dan Muey wrote: > Hmm ok, what would be nice is to do something like this: > (I have a function that returns true if the perl version is the same or > higher than the specified number) > > package Monkey; > > use strict; > > if(gotperlv(5.6)) { > o

RE: our vs. use vars

2003-10-28 Thread Wiggins d Anconia
Many of your questions lately have been wrapped around scoping/packages/symbol tables, etc. have you had a read through: http://perl.plover.com/FAQs/Namespaces.html ?? I found it most informative. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

RE: our vs. use vars

2003-10-28 Thread Dan Muey
Hmm ok, what would be nice is to do something like this: (I have a function that returns true if the perl version is the same or higher than the specified number) package Monkey; use strict; if(gotperlv(5.6)) { our $bar our $foo; } else { use vars qw($bar $foo); } Exce

RE: our vs. use vars

2003-10-28 Thread Dan Muey
> "use vars" and "our" do roughly the same thing. They both > let you use package variables under strict without fully-qualifying. > > All these code snippets pass strict, and they each set the > package variable $foo ($A::foo, $B::foo, and $C::foo). > > use strict; > > { > pack

Re: our vs. use vars

2003-10-28 Thread Steve Grazzini
On Tue, Oct 28, 2003 at 10:52:16AM -0600, Dan Muey wrote: > I want to use the newer our $variable; but to make it work > with pre 5.6 Perl (or whatever version our appeared in) I > have to do the use vars qw($variable); method > > So I was wanting some input about pros and cons of using > eithe

Re: our vs. use vars

2003-10-28 Thread Rob Dixon
eared in) I > > > have to do the use vars qw($variable); method > > > > > > So I was wanting some input about pros and cons of using > > > either since on the surface they appear to do the same > > > thing except that use vars is backwards compatable. &g

RE: our vs. use vars

2003-10-28 Thread Dan Muey
gt; > So I was wanting some input about pros and cons of using > either since > > on the surface they appear to do the same thing except that > use vars > > is backwards compatable. > > > > Any input on our vs. use vars ?? Pro,con, neutral ?? > > Hi Dan

Re: our vs. use vars

2003-10-28 Thread Rob Dixon
d cons of using > either since on the surface they appear to do the same thing > except that use vars is backwards compatable. > > Any input on our vs. use vars ?? Pro,con, neutral ?? Hi Dan. The main issue about 'our' as opposed to 'use vars' is that the of scope.

our vs. use vars

2003-10-28 Thread Dan Muey
surface they appear to do the same thing except that use vars is backwards compatable. Any input on our vs. use vars ?? Pro,con, neutral ?? TIA Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]