Front page | perl.perl5.porters |
Postings from July 2009
Re: Perl 5.10.1
From: John Peacock
July 2, 2009 02:51
Re: Perl 5.10.1
Message ID: 4A4C82F3.firstname.lastname@example.org
Marvin Humphrey wrote:
> I like the way that fine grained control is the responsibility of the module
> author under the version::Limit model, while the user is only responsible for
> requesting an interface in the form of a package name and a version number.
That was, indeed, the idea. The module author promises a stable API with strong
strictures that the module user can rely on. As part of this discussion,
however, it has occurred to me that the module author could go farther and
provide exactly the API that the user requested, while still providing a new API
to new users. In other words, one could have a single package that contained
both modperl and modperl2 compatible API's and it would switch based on the
requested version number that the user specifies (which is a bad example because
there is already a way to do that).
Of course, right now that is just speculation on my part; I have a raft of other
things that I need to release to CPAN first before I develop this extension.
But I already know how I can do it, which is 50% of the problem; the rest is SMOP...
> Hmm, I'm not sure I'd always take advantage of that. Would this "use base"
> directive fail because it omits the version number?
> use LimitTest 3;
> use base qw( LimitTest );
No; in fact that is the only way it would work. You don't "need" the first line
in order for 'base' to do it's thing (it will implicitly load the class), but
since Perl will only load a class once, the 'use base' will merely set up the