develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [PATCH] making Exporter simpler to use

Thread Previous | Thread Next
Fergal Daly
February 11, 2003 16:38
Re: [PATCH] making Exporter simpler to use
Message ID:
On Tuesday 11 February 2003 20:07, John Peacock wrote:
> I think Brent is just more concerned about what happens when a module uses
> the new interface, but the user doesn't have that version of Exporter
> available. Having an ugly effect on earlier Perl's is not good, no matter
> how nice the improvements are.

I think Brent's point was that if people start taking advantage of this nice 
interface for their modules, then their modules will not work on earlier 
Perl's that don't have it. My point is that people can totally ignore this 
interface, it has zero effect on any module that doesn't about know it. It 
might be enough to just tell module authors not to use it if they are going 
to distribute their module to users of older Perls.

It's no worse than writing modules that use 5.6 style attributes when there 
were lots of people who didn't have 5.6.

> > Alternatively, I could just move the whole thing into EasyExporter or
> > Exporter::Easy as it is totally independent of the guts of Exporter. That
> > makes it easy for people to install it on an old version too.
> I suggest you follow this route and create Exporter::Easy as you mentioned;
> then, if the pumpking deems this a worthy addition to the core, you can
> make sure that 'use Exporter::Easy' is effectively a no-op for Perl >
> 5.9.0.

Yup, done.

I've also added Exporter::Easiest which lets you do this

use Exporter::Easiest q(
	OK => munge frobnicate
	EXPORT => :tag1
	TAGS =>
		:tag1 => a b c
		:tag2 => :tag1 d e f
	FAIL => f g h

No need for horrible []s and qw()s and ,s all over the place. I've uploaded it 
to CPAN but I'm not sure how long that'll take so you can get it from this 
directory too


Do you need someone with lots of Unix sysadmin and/or lots of OO software 
development experience? Go on, giz a job.
My CV -

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About