develooper Front page | perl.perl5.porters | Postings from September 2012

[perl #114770] [patch] constant.pm: remove 5.6 checks, small test adjustment for 5.8

Thread Next
From:
Sebastien Aperghis-Tramoni
Date:
September 5, 2012 14:07
Subject:
[perl #114770] [patch] constant.pm: remove 5.6 checks, small test adjustment for 5.8
Message ID:
rt-3.6.HEAD-11172-1346876035-1857.114770-75-0@perl.org
# New Ticket Created by  Sebastien Aperghis-Tramoni 
# Please include the string:  [perl #114770]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114770 >



This is a bug report for perl from saper@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.16.1.

Hello,


Attached are two patches for constant.pm:
* constant.pm-1.24-remove-5.6-checks.diff
  Given constant.pm is no longer compatible with Perl 5.6 and previous,
  the parts of the code that check for these versions can be removed.

* constant.pm-1.24-utf8-test.diff
  Needed so the tests pass on Perl 5.8.0 to 5.8.3


Regards,

Sébastien Aperghis-Tramoni


file: constant.pm-1.24-remove-5.6-checks.diff
--- blead/dist/constant/lib/constant.pm	2012-09-04 11:15:26.000000000 +0200
+++ blead/dist/constant/lib/constant.pm	2012-09-05 21:25:14.000000000 +0200
@@ -1,5 +1,5 @@
 package constant;
-use 5.005;
+use 5.008;
 use strict;
 use warnings::register;
 
@@ -17,10 +17,9 @@
 
 my %forbidden = (%keywords, %forced_into_main);
 
-my $str_end = $] >= 5.006 ? "\\z" : "\\Z";
-my $normal_constant_name = qr/^_?[^\W_0-9]\w*$str_end/;
-my $tolerable = qr/^[A-Za-z_]\w*$str_end/;
-my $boolean = qr/^[01]?$str_end/;
+my $normal_constant_name = qr/^_?[^\W_0-9]\w*\z/;
+my $tolerable = qr/^[A-Za-z_]\w*\z/;
+my $boolean = qr/^[01]?\z/;
 
 BEGIN {
     # We'd like to do use constant _CAN_PCS => $] > 5.009002
--- blead/dist/constant/t/constant.t	2009-12-28 13:04:37.000000000 +0100
+++ blead/dist/constant/t/constant.t	2012-09-04 11:17:30.000000000 +0200
@@ -167,7 +167,6 @@
 @warnings = ();
 eval q{
     no warnings;
-    #local $^W if $] < 5.006;
     use warnings 'constant';
     use constant 'BEGIN' => 1 ;
     use constant 'INIT' => 1 ;


file: constant.pm-1.24-utf8-test.diff
--- blead/dist/constant/t/utf8.t	2011-04-18 10:16:25.000000000 +0200
+++ blead/dist/constant/t/utf8.t	2012-09-03 17:04:36.000000000 +0200
@@ -1,9 +1,15 @@
 #!./perl -T
 
+use Test::More;
+BEGIN {
+    plan skip_all => "irrelevant on pre-5.8.4" if $] < 5.008004
+}
+
 # Tests for constant.pm that require the utf8 pragma
 
 use utf8;
-use Test::More tests => 2;
+
+plan tests => 2;
 
 use constant π		=> 4 * atan2 1, 1;
 
---
Flags:
    category=library
    severity=low
    module=constant
---
Site configuration information for perl 5.16.1:

Configured by maddingue at Tue Aug 14 00:18:54 CEST 2012.

Summary of my perl5 (revision 5 version 16 subversion 1) configuration:
   
  Platform:
    osname=darwin, osvers=11.4.0, archname=darwin-2level
    uname='darwin landroval.local 11.4.0 darwin kernel version 11.4.0: mon apr 9 19:32:15 pdt 2012; root:xnu-1699.26.8~1release_x86_64 x86_64 '
    config_args='-des -Dprefix=/opt/perl/5.16.1'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/opt/local/include',
    optimize='-O3',
    cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/opt/local/include'
    ccversion='', gccversion='4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.45)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /usr/lib
    libs=-lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.16.1:
    /opt/perl/5.16.1/lib/site_perl/5.16.1/darwin-2level
    /opt/perl/5.16.1/lib/site_perl/5.16.1
    /opt/perl/5.16.1/lib/5.16.1/darwin-2level
    /opt/perl/5.16.1/lib/5.16.1
    .

---
Environment for perl 5.16.1:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/maddingue
    LANG=fr_FR.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/opt/perl/current/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash


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