develooper Front page | perl.perl5.porters | Postings from January 2004

Re: [perl #25268] h2xs does not create VERSION stubs

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
January 28, 2004 19:40
Subject:
Re: [perl #25268] h2xs does not create VERSION stubs
Message ID:
20040128001550.GA11197@localhost.comcast.net
On Mon, Jan 26, 2004 at 06:59:55AM -0000, davidnico@cpan.org (via RT) wrote:
> nobody knows about the VERSION method except people who
> have thoroughly read perldoc -f use.  I believe that it
> would be a good thing if h2xs added a default VERSION
> method to the code it creates, and commented it out.  This
> commented-out code would have an obvious way to edit it in
> order to create a VERSION method that knows what lower version
> numbers the current version is incompatbile with.  

I'm not a fan of adding more code to the h2xs template that's not strictly
necessary.  The h2xs template is designed to get a new module author off
the ground with a minimum of fuss.  Throwing in more code will be confusing.  

This is also not code commonly put in brand new modules.  Version 
incompatibilities of the type you're talking about don't become
important until many versions down the road, if ever at all, at which point 
they've presumably figured it out themselves.

Rather than saddling every h2xs module with cut & code, it would
better be put into a module.  Version::Compatibility or something.


> 	sub VERSION{
> 		... not sure exactly what goes here,
> 		but it parses (keys %VERSION_INCOMPATIBILITY)
> 		comparing each to the provided parameter; 
> 		`perldoc -f use` is not clear on whether the
> 		desired version arrives in $_[0] or $_[1] ...
> 
> 	}

VERSION() is documented in the man page for UNIVERSAL.  As its a method, 
the optional version # comes in on $_[1].


-- 
Michael G Schwern        schwern@pobox.com  http://www.pobox.com/~schwern/
You'll do.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About