> 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)) {
> > our $bar
> > our $foo;
> > } else {
> > use vars qw($bar $foo);
> > }
> >
> > Except the ours would only apply to that black and wouldn't do too
> > much good if I'm understanding this right. And also would
> it not always
> > do the use vars since it gets done in the BEGIN black ?
>
> Yep -- you're right on both counts. If you want to support
> older versions of perl ($] < 5.006) you just have to "use
> vars" and forget
> about "our".
>
> 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:
our @ISA = qw(Exporter);
and
use base qw(Exporter);
Is one more compatible with certain versions or better or worse ??
It seems use base would be better since it handles @ISA and will do a better job at it
than I.
A little OT but why not!
Dan
> our @EXPORT = qw(...);
>
> --
> Steve
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]