develooper Front page | perl.perl5.porters | Postings from May 2013

[patch] modernize h2xs small little but useful bit

From:
vadim.konovalov
Date:
May 6, 2013 07:50
Subject:
[patch] modernize h2xs small little but useful bit
Message ID:
DC0095F744C45F45BDD43368AB46582C01BEE2@FR712WXCHMBA09.zeu.alcatel-lucent.com
Having empty Hehe.h file, the command
 h2xs Hehe
generates this Matefile.PL:

use 5.016000;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
    NAME              => 'Hehe',
    VERSION_FROM      => 'lib/Hehe.pm', # finds $VERSION
    PREREQ_PM         => {}, # e.g., Module::Name => 1.1
    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
      (ABSTRACT_FROM  => 'lib/Hehe.pm', # retrieve abstract from module
       AUTHOR         => 'A. U. Thor <a.u.thor@a.galaxy.far.far.away>') : ()),
    LIBS              => [''], # e.g., '-lm'
    DEFINE            => '', # e.g., '-DHAVE_SOMETHING'
    INC               => '-I.', # e.g., '-I. -I/usr/include/other'
	# Un-comment this if you add C files to link with later:
    # OBJECT            => '$(O_FILES)', # link all the C files too
);
.....(et cetera) .....

This check "$] >= 5.005 ? " is adding non-useful noise,
 - 5.004 not supported anyway,
 - and even it requires 5.16.0 at the very first line.

This noise appears then in CPAN modules, i.e. I see it refularily on CPAN.
Hence the sooner this idea applied the better.........

Attached is a small preliminary patch,
maybe it needs version adjustment and futher modifications?
my( $H2XS_VERSION ) = ' $Revision: 1.23 $ ' =~ /\$Revision:\s+([^\s]+)/;

regards,
Vadim.


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