Re: [PATCH blead] Make t/op/local.t use test.pl.
On Wed, 7 Sep 2005 22:45:44 -0400, Rick Delaney [EMAIL PROTECTED] wrote: I wanted to add some tests to the middle of t/op/local.t but saw I'd have to renumber everything. Patch 1 changes it to use test.pl so numbering doesn't matter. Patch 2 moves some tests where they belong. My tests are forthcoming. Wasn't this because the t/op (at least most of them) were testing basic stuff that was too basic to allow test.pl? -- H.Merijn BrandAmsterdam Perl Mongers (http://amsterdam.pm.org/) using Perl 5.6.2, 5.8.0, 5.8.5, 5.9.2 on HP-UX 10.20, 11.00 11.11, AIX 4.3 5.2, SuSE 9.2 9.3, and Cygwin. http://www.cmve.net/~merijn Smoking perl: http://www.test-smoke.org,perl QA: http://qa.perl.org reports to: [EMAIL PROTECTED],perl-qa@perl.org
Re: [EMAIL PROTECTED] VMS fixes for cbuilder
On Wed, 07 Sep 2005 19:59:36 -0400, John E. Malmberg [EMAIL PROTECTED] wrote: This patch is needed for the lib/ExtUtils/ParseXS.t/basic.t test to pass on VMS. Thanks, applied as change #25364 I really like the way you explain your patches. This one applied 100% clean In lib/ExtUtils/CBuilder/Platform/VMS.pm, VMS needs to have a pre-link file generated. In lib/ExtUtils/CBuilder/Base.pm: VMS can only have one /include qualifier on the CC command, and the last one wins, so if one is present in @ccflags, remove it. VMS needs to have the executable named the same way that dynaloader will look for it. VMS needs to have two option files specified in the link, one to indicate the exported symbols, and one to locate the PERLSHR image. -- H.Merijn BrandAmsterdam Perl Mongers (http://amsterdam.pm.org/) using Perl 5.6.2, 5.8.0, 5.8.5, 5.9.2 on HP-UX 10.20, 11.00 11.11, AIX 4.3 5.2, SuSE 9.2 9.3, and Cygwin. http://www.cmve.net/~merijn Smoking perl: http://www.test-smoke.org,perl QA: http://qa.perl.org reports to: [EMAIL PROTECTED],perl-qa@perl.org
Re: [PATCH blead] Make t/op/local.t use test.pl.
On 9/8/05, H.Merijn Brand [EMAIL PROTECTED] wrote: On Wed, 7 Sep 2005 22:45:44 -0400, Rick Delaney [EMAIL PROTECTED] wrote: I wanted to add some tests to the middle of t/op/local.t but saw I'd have to renumber everything. Patch 1 changes it to use test.pl so numbering doesn't matter. Patch 2 moves some tests where they belong. My tests are forthcoming. Wasn't this because the t/op (at least most of them) were testing basic stuff that was too basic to allow test.pl? There are already 50 tests in t/op that use test.pl. One could argue that test.pl uses local(), but basically I think applying Rick's patch is harmless.
Re: [PATCH blead] Make t/op/local.t use test.pl.
On Wed, 7 Sep 2005 22:45:44 -0400, Rick Delaney [EMAIL PROTECTED] wrote: I wanted to add some tests to the middle of t/op/local.t but saw I'd have to renumber everything. Patch 1 changes it to use test.pl so numbering doesn't matter. Patch 2 moves some tests where they belong. My tests are forthcoming. Thanks, both applied in change #25365 -- H.Merijn BrandAmsterdam Perl Mongers (http://amsterdam.pm.org/) using Perl 5.6.2, 5.8.0, 5.8.5, 5.9.2 on HP-UX 10.20, 11.00 11.11, AIX 4.3 5.2, SuSE 9.2 9.3, and Cygwin. http://www.cmve.net/~merijn Smoking perl: http://www.test-smoke.org,perl QA: http://qa.perl.org reports to: [EMAIL PROTECTED],perl-qa@perl.org
Smoke [5.9.0] 25363 FAIL(m) openbsd 3.6 (i386/1 cpu)
Automated smoke report for 5.9.0 patch 25363 accognoscere.homeunix.org: AMD Athlon(TM) XP 1800+ (AuthenticAMD 686-class) (i386/1 cpu) onopenbsd - 3.6 using cc version 2.95.3 20010125 (prerelease, propolice) smoketime 3 minutes 1 seconds (average 22.625 seconds) Summary: FAIL(m) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (after miniperl), t = make test-prep 25363 Configuration (common) none --- - m - m - m - m - -Duse64bitint m - m - -Duseithreads m - m - -Duseithreads -Duse64bitint | | | +- PERLIO = perlio -DDEBUGGING | | +--- PERLIO = stdio -DDEBUGGING | +- PERLIO = perlio +--- PERLIO = stdio -- Report by Test::Smoke v1.19#716 running on perl 5.8.5 (Reporter v0.016 / Smoker v0.015)
[perl #37101] my $v if (0); leaves $v around
# New Ticket Created by [EMAIL PROTECTED] # Please include the string: [perl #37101] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37101 This is a bug report for perl from [EMAIL PROTECTED], generated with the help of perlbug 1.35 running under perl v5.8.6. - The following program invokes beta once instead of twice. Extremely non-intuitive. moving the #' down one line fixes it. 1) seems like it shouldn't compile. 2) $c is static and keeps its value between invocations if one instead of if (0) one has if ($b) This is boiled down from a real program, of course. thanks, Bruce --cut-- use strict 'vars'; sub beta ($) { my $a = shift; print beta($a)\n; xyz; } sub alpha ($) { my ( $a, $b ) = @_; print alpha($a)\n; # my $c; my $c = 1 if (0); $c = beta ($a) if ( ! defined $c ); } alpha( 'A'); alpha( 'B'); --cut-- haven't analyzed this one thoroughly: --cut 2-- use strict 'vars'; sub beta ($) { my $a = shift; print beta($a)\n; xyz; } sub alpha ($$) { my ( $a, $b ) = @_; print alpha($a)\n; # my $c; my $c = 1 if ($b); $c = beta ($a) if ( ! defined $c ); } alpha( 'A',0); alpha( 'B',0); --cut 2-- - --- Flags: category=core severity=low --- Site configuration information for perl v5.8.6: Configured by brucer at Tue Jan 4 17:17:23 PST 2005. Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Platform: osname=linux, osvers=2.4.20-34.7.cisco.1smp, archname=i686-linux uname='linux gsg-lnx-bld1.cisco.com 2.4.20-34.7.cisco.1smp #1 smp wed jun 23 15:03:42 edt 2004 i686 unknown ' config_args='-Dcc=gcc -Dprefix=/auto/gsg-sw/inst/i686-pc-linux-gnu -des' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='2.96 2731 (Red Hat Linux 7.3 2.96-112)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.2.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: --- @INC for perl v5.8.6: /auto/gsg-sw/inst/i686-pc-linux-gnu/lib/perl5/5.8.6/i686-linux /auto/gsg-sw/inst/i686-pc-linux-gnu/lib/perl5/5.8.6 /auto/gsg-sw/inst/i686-pc-linux-gnu/lib/perl5/site_perl/5.8.6/i686-linux /auto/gsg-sw/inst/i686-pc-linux-gnu/lib/perl5/site_perl/5.8.6 /auto/gsg-sw/inst/i686-pc-linux-gnu/lib/perl5/site_perl . --- Environment for perl v5.8.6: HOME=/users/brucer LANG=en_US LANGUAGE (unset) LD_LIBRARY_PATH= LOGDIR (unset) PATH=/auto/gsg-sw/inst/i686-pc-linux-gnu/bin:/auto/gsg-sw/inst/share.brucer/sbin:/auto/gsg-sw/inst/share.brucer/bin:/usr/java/j2re1.4.1_01/bin:/users/brucer/share/bin:/router/bin:/usr/local/packages/atria/current/contrib:/usr/cisco/bin:/usr/atria/bin:/nfs/ddts/ddtshome/bin:/bin:/usr/sbin:/usr/bin:/auto/gsg-sw/share:/usr/openwin/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin PERL_BADLANG (unset) SHELL=/bin/bash
Re: [perl #37101] my $v if (0); leaves $v around
On Wed, Sep 07, 2005 at 05:19:55PM -0700, brucer @ gsg-lnx-bld1. cisco. com wrote: The following program invokes beta once instead of twice. Extremely non-intuitive. moving the #' down one line fixes it. 1) seems like it shouldn't compile. 2) $c is static and keeps its value between invocations if one instead of if (0) one has if ($b) This is boiled down from a real program, of course. This is a well-known problem, which is difficult to fix without breaking backwards compatibility (some people make use of the 'feature' to create static variables). The problem boils down to: If the 'my $x' is skipped at runtime, then at scope exit the variable isn't freed, meaning that on next scope entry the variable maintains its old value. -- Standards (n). Battle insignia or tribal totems.
[perl #37102] Perl regexp state gets clobbered (includes a fix)
# New Ticket Created by Geoff Mottram # Please include the string: [perl #37102] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37102 The following problem has been observed under versions of Perl after 5.8.4 on Linux and Windows including the most recent stable version (5.8.7). The script that experienced the problem is too complex to include and requires a connection to a database server. A patch with a fix is provided at the end of this email. The following regex was causing either an Out of Memory condition or a segmentation fault after two iterations: if ($a =~ m/^([A-Za-z]+)(.*)/) It was caused by the PL_regeol variable of regexec.c getting overwritten when in the av_store() call on line 4370 of regexec.c (see gdb backtrace below): if (a) sw = *a; else if (si doinit) { sw = swash_init(utf8, , si, 1, 0); (void)av_store(av, 1, sw); } When av_store is called, the previous positional parameter is de-referenced and its DESTROY method is called. I could not figure out what object was being destroyed but the gdb backtrace will probably ring a few bells for you. The script was working with UTF-8 content and wide characters, which I suspect was related to the problem. In any case, the DESTROY method that was called included a regular expression that would trash the state of the regular expression engine a few methods up the stack. My solution is given in a patch at the very end of this email. Please excuse the comment with my name but it will allow me to find my fix in my copy of Perl should I need to in the future. I added the following call to sv_clear() in sv.c: save_re_context(); just prior to the call to the object's DESTROY method. This allows regular expressions to be used in the DESTROY method of whatever object is being used as a positional variable in a regular expression (a Unicode string?). I agree with the comments above the save_re_context() function that this is a really kludgey way for the regular expression engine to be written. The engine should store its state in a stack or allocated structure that is passed to its subroutines and not use global variables. I am afraid that there may be other sections in Perl that will also require calls to save_re_context() that have not been discovered yet. Thanks for getting my fix in to the Perl distribution. Sincerely, Geoff Mottram [EMAIL PROTECTED] --Output of perl -V Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Platform: osname=linux, osvers=2.4.21-27.0.2.elsmp, archname=i686-linux uname='linux classificationweb.net 2.4.21-27.0.2.elsmp #1 smp wed jan 12 23:35:44 est 2005 i686 i686 i386 gnulinux ' config_args='-de' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DDEBUGGING', optimize='-g', cppflags='-fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DDEBUGGING' ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-49)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING USE_LARGE_FILES Built under linux Compiled at Sep 7 2005 06:10:19 @INC: /usr/local/lib/perl5/5.8.7/i686-linux /usr/local/lib/perl5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/i686-linux
Smoke [5.9.3] 25364 FAIL(XF) bsd/os 4.1 (i386/1 cpu)
Automated smoke report for 5.9.3 patch 25364 fixit.xs4all.nl: Pentium II (i386/1 cpu) onbsd/os - 4.1 using cc version egcs-2.91.66 19990314 (egcs-1.1.2 release) smoketime 3 hours 56 minutes (average 1 hour 58 minutes) Summary: FAIL(XF) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (after miniperl), t = make test-prep 25364 Configuration (common) none --- - F F - - -Duse64bitint X O - - | | | +- PERLIO = perlio -DDEBUGGING | | +--- PERLIO = stdio -DDEBUGGING | +- PERLIO = perlio +--- PERLIO = stdio Failures: (common-args) none [stdio/perlio] -Duse64bitint ../t/op/int.t...FAILED 11 [stdio] Inconsistent test results (between TEST and harness): ../lib/Net/hostent.tFAILED at test 4 -- Report by Test::Smoke v1.19_67 build 842 running on perl 5.00503 (Reporter v0.019 / Smoker v0.023)
Re: [perl #37101] my $v if (0); leaves $v around
The following program invokes beta once instead of twice. Extremely non-intuitive. Really? It is effectively: $c = beta ($a) if ( ! defined $c ); # the if condition is true $c = beta ($a) if ( ! defined $c ); # the if condition is false 1) seems like it shouldn\'t compile. Why not? 2) $c is static and keeps its value between invocations Yes, because it is not my-ed. I've seen the exact explaination that my declarations with if 0 are no-ops, somewhere in Perl PODs.
Re: [EMAIL PROTECTED] VMS fixes for cbuilder
Hi John, Thanks for the patch. A couple questions: 1) I see both /include and /Include specified in various places in the source. Should your s/// be case-insensitive? 2) Would it be more appropriate to fold the include-dirs from ccflags into the user-specified ones, rather than throwing them away? For the include-dirs issues, I'm thinking of a patch more like this instead: === --- lib/ExtUtils/CBuilder/Platform/VMS.pm 2005/05/20 00:50:04 1.7 +++ lib/ExtUtils/CBuilder/Platform/VMS.pm 2005/09/08 02:50:23 @@ -11,6 +11,13 @@ sub arg_include_dirs { - my $self = shift; - return '/include=(' . join(',', @_) . ')'; + my ($self, @dirs) = @_; + + # VMS can only have one include list, remove the one from config. + if ($self-{config}{ccflags} =~ s{/include=\(([^\)]*)\)} {}i) { +unshift @dirs, $1; + } + return unless @dirs; + + return ('/include=(' . join(',', @dirs) . ')'); } === Thanks, -Ken On Sep 7, 2005, at 6:59 PM, John E. Malmberg wrote: This patch is needed for the lib/ExtUtils/ParseXS.t/basic.t test to pass on VMS. In lib/ExtUtils/CBuilder/Platform/VMS.pm, VMS needs to have a pre-link file generated. In lib/ExtUtils/CBuilder/Base.pm: VMS can only have one /include qualifier on the CC command, and the last one wins, so if one is present in @ccflags, remove it. VMS needs to have the executable named the same way that dynaloader will look for it. VMS needs to have two option files specified in the link, one to indicate the exported symbols, and one to locate the PERLSHR image.
Re: [EMAIL PROTECTED] VMS fixes for cbuilder
Hi John, After my last email I reworked the patch so that all the modifications are in Platform/VMS.pm. Could you confirm that it still works for you and I haven't broken it? Thanks, -Ken Index: lib/ExtUtils/CBuilder/Platform/VMS.pm === RCS file: /Users/ken/src/CVS-repository/modules/ExtUtils-CBuilder/lib/ExtUtils/ CBuilder/Platform/VMS.pm,v retrieving revision 1.7 diff -u -r1.7 VMS.pm --- VMS.pm 2005/05/20 00:50:04 1.7 +++ VMS.pm 2005/09/08 12:17:04 @@ -7,11 +7,40 @@ $VERSION = '0.12'; @ISA = qw(ExtUtils::CBuilder::Base); -sub need_prelink { 0 } +sub need_prelink { 1 } sub arg_include_dirs { - my $self = shift; - return '/include=(' . join(',', @_) . ')'; + my ($self, @dirs) = @_; + + # VMS can only have one include list, remove the one from config. + if ($self-{config}{ccflags} =~ s{/include=\(([^\)]*)\)} {}i) { +unshift @dirs, $1; + } + return unless @dirs; + + return ('/include=(' . join(',', @dirs) . ')'); +} + +sub _do_link { + my ($self, $type, %args) = @_; + + my $objects = delete $args{objects}; + $objects = [$objects] unless ref $objects; + + # VMS has two option files, the external symbol, and to pull in PerlShr + $objects-[-1] .= ','; + push @$objects, 'sys$disk:[]' . @temp_files[0] . '/opt,'; + push @$objects, $self-perl_inc() . 'PerlShr.Opt/opt'; + + # Need to create with the same name as DynaLoader will load with. + if (defined DynaLoader::mod2fname) { +my $out = $args{$type} || $self-$type($objects-[0]); +my ($dev,$dir,$file) = File::Spec-splitpath($out); +$file = DynaLoader::mod2fname([$file]); +$args{$type} = File::Spec-catpath($dev,$dir,$file); + } + + return $self-SUPER::_do_link($type, %args, objects = $objects); } sub arg_nolink { return; } === On Sep 7, 2005, at 6:59 PM, John E. Malmberg wrote: This patch is needed for the lib/ExtUtils/ParseXS.t/basic.t test to pass on VMS. In lib/ExtUtils/CBuilder/Platform/VMS.pm, VMS needs to have a pre-link file generated. In lib/ExtUtils/CBuilder/Base.pm: VMS can only have one /include qualifier on the CC command, and the last one wins, so if one is present in @ccflags, remove it. VMS needs to have the executable named the same way that dynaloader will look for it. VMS needs to have two option files specified in the link, one to indicate the exported symbols, and one to locate the PERLSHR image.
[PATCH blead] Re: [perl #36733] %SIG not properly local-ized
This is a bug report for perl from [EMAIL PROTECTED], generated with the help of perlbug 1.35 running under perl v5.8.6. - The construct local %SIG = %SIG; does *not* make an exact local copy of %SIG, as it should. Please look at the following patch. I really don't understand what needs_store is for but keeping it TRUE for %SIG seems to fix this. Anyway, the tests should be good. -- Rick Delaney [EMAIL PROTECTED] diff -pruN perl-current/hv.c perl-current-dev/hv.c --- perl-current/hv.c 2005-08-30 05:37:41.0 -0400 +++ perl-current-dev/hv.c 2005-09-08 08:31:28.458708179 -0400 @@ -861,7 +861,6 @@ S_hv_magic_check(pTHX_ HV *hv, bool *nee *needs_copy = TRUE; switch (mg-mg_type) { case PERL_MAGIC_tied: - case PERL_MAGIC_sig: *needs_store = FALSE; return; /* We've set all there is to set. */ } diff -pruN perl-current/t/op/local.t perl-current-dev/t/op/local.t --- perl-current/t/op/local.t 2005-09-08 03:50:38.0 -0400 +++ perl-current-dev/t/op/local.t 2005-09-08 08:30:03.296126706 -0400 @@ -4,7 +4,7 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; } -plan tests = 79; +plan tests = 85; sub foo { local($a, $b) = @_; @@ -93,6 +93,11 @@ ok(!defined $a[0]); shift @a; } is($a[0].$a[1], Xb); +{ +my $d = @a; +local @a = @a; +is(@a, $d); +} %h = ('a' = 1, 'b' = 2, 'c' = 3); { @@ -105,6 +110,11 @@ is($a[0].$a[1], Xb); } is($h{'a'}, 1); is($h{'b'}, 2); +{ +my $d = join(\n, map { $_=$h{$_} } sort keys %h); +local %h = %h; +is(join(\n, map { $_=$h{$_} } sort keys %h), $d); +} is($h{'c'}, 3); # check for scope leakage @@ -146,6 +156,11 @@ tie @a, 'TA'; is($a[1], 'b'); is($a[2], 'c'); ok(!defined $a[0]); +{ +my $d = @a; +local @a = @a; +is(@a, $d); +} { package TH; @@ -155,6 +170,8 @@ ok(!defined $a[0]); sub EXISTS { print # EXISTS [EMAIL PROTECTED]; exists $_[0]-{$_[1]}; } sub DELETE { print # DELETE [EMAIL PROTECTED]; delete $_[0]-{$_[1]}; } sub CLEAR { print # CLEAR [EMAIL PROTECTED]; %{$_[0]} = (); } +sub FIRSTKEY { print # FIRSTKEY [EMAIL PROTECTED]; keys %{$_[0]}; each %{$_[0]} } +sub NEXTKEY { print # NEXTKEY [EMAIL PROTECTED]; each %{$_[0]} } } # see if localization works on tied hashes @@ -177,6 +194,12 @@ is($h{'c'}, 3); # local() should preserve the existenceness of tied hash elements ok(! exists $h{'y'}); ok(! exists $h{'z'}); +TODO: { +todo_skip(Localize entire tied hash); +my $d = join(\n, map { $_=$h{$_} } sort keys %h); +local %h = %h; +is(join(\n, map { $_=$h{$_} } sort keys %h), $d); +} @a = ('a', 'b', 'c'); { @@ -203,6 +226,11 @@ $SIG{__WARN__} = $SIG{INT}; is($SIG{TERM}, 'main::foo'); is($SIG{INT}, \foo); is($SIG{__WARN__}, \foo); +{ +my $d = join(\n, map { $_=$SIG{$_} } sort keys %SIG); +local %SIG = %SIG; +is(join(\n, map { $_=$SIG{$_} } sort keys %SIG), $d); +} # and for %ENV @@ -225,6 +253,11 @@ is($ENV{_Z_}, 'c'); # local() should preserve the existenceness of %ENV elements ok(! exists $ENV{_A_}); ok(! exists $ENV{_B_}); +{ +my $d = join(\n, map { $_=$ENV{$_} } sort keys %ENV); +local %ENV = %ENV; +is(join(\n, map { $_=$ENV{$_} } sort keys %ENV), $d); +} # does implicit localization in foreach skip magic?
Re: [EMAIL PROTECTED] VMS fixes for cbuilder
Ken Williams wrote: Hi John, After my last email I reworked the patch so that all the modifications are in Platform/VMS.pm. Could you confirm that it still works for you and I haven't broken it? I will not be able to get to it for at least 10 hours, and it will probably be a bit longer, but I can answer your questions now. Thanks for the patch. A couple questions: 1) I see both /include and /Include specified in various places in the source. Should your s/// be case-insensitive? Yes it should be case insensitive. Also VMS accepts the shortest unique abbreviations, so a case insensitive test for /inc to end of string or next qualifier is needed to find all the cases. The full qualifier name is /INCLUDE_DIRECTORY= , but using that full name runs in to command line length restrictions. 2) Would it be more appropriate to fold the include-dirs from ccflags into the user-specified ones, rather than throwing them away? In the case of the modules being built, both had an include for '[]' in them, so it did not matter. For correctness the includes should be merged. Actually several things should be merged like /DEFINE=(xxx,xxx,xxx). It gets complicated because the () is only needed if there is more than one option. It may be better for VMS to borrow a solution from the GNV package. The Open Source GNV package on VMS uses a program named GCC.EXE that accepts the qualifiers in UNIX format and then spawns the VMS C compiler with them translated. But that type of change may take some time to integrate in with Perl. It also adds another subprocess, and some VMS environments may be sensitive to that. Tonight I will be doing a full build and test run of the current blead-perl on OpenVMS Alpha 8.2, which will probably not complete until tomorrow. I currently have 4 tests including this one to investigate on Blead for VMS, the other ones are ZLIB and TAR, and the maintainer of ZLIB also needs someone to test their latest kit. -John [EMAIL PROTECTED] Personal Opinion Only
Re: Encode on EBCDIC patch( Doesn't Work)
Hi Dan The patch you had provided calls $_ebcdic_coder-decode($str); and subsequenly calls my $octets = $enc-encode($string,$check); Do you think it is how it is supposed to call on EBCDIC platform? Seems like this is a work around But there is another test case(lib/DBM_Filter/t/encode.t) in the test suite that fails because of this encoding module Here is the snippet of that test case eval { $db1-Filter_Push('encode' = 'iso-8859-16') }; is $@, '', push an 'encode' filter (specify iso-8859-16) ; use charnames qw{:full}; StoreData(\%h1, { 'euro' = \N{EURO SIGN}, }); VerifyData(\%h2, { 'euro' = \xA4, }); The 'euro' gets stored as /Ä, instead of the 'euro' itself. Please check if there is a work round for this too or any pointers in the source code where there could be a fix for it! -Sastry On 8/24/05, Dan Kogai [EMAIL PROTECTED] wrote: Sastry and EBCDIC porters, On Aug 24, 2005, at 21:30 , Dan Kogai wrote: + sub _utf8_ebcdic($){ + my $str = shift; # UTF-8 + $str = # UTF-EBCDIC + $_ebcdic_coder-encode($str); + _utf8_on($str); # Dirty Trick + return $str; I'm not sure if this part works as advertised. The yet another patch below tries the different approach. The problem is that I know so little of UTF-EBCDIC and its implementation. I feel like building a ship in the bottle in the dark Dan the Encode Maintainer === RCS file: Encode.pm http://Encode.pm,v retrieving revision 2.11 diff -u -r2.11 Encode.pm http://Encode.pm --- Encode.pm http://Encode.pm 2005/08/05 10:58:25 2.11 +++ Encode.pm http://Encode.pm 2005/08/24 12:49:18 @@ -136,6 +136,27 @@ return Storable::dclone($obj); } +sub _ebcdic_utf8($); +sub _utf8_ebcdic($); + +if ($ON_EBCDIC){ + my %WHICH_EBCDIC = ( 176 = 'cp37', 95 = 'cp1047', 106 = 'posix-bc' ); + my $_ebcdic_coder = find_encoding($WHICH_EBCDIC{ord ^}); + sub _ebcdic_utf8($){ + my $str = shift; # UTF-EBCDIC + _utf8_off($str); # Dirty Trick + return # UTF-8 + $_ebcdic_coder-decode($str); + } + sub _utf8_ebcdic($){ + my $str = shift; # UTF-8 + $str = # EBCDIC + $_ebcdic_coder-encode($str); + return # UTF-EBCDIC; + find_encoding(Unicode)-decode($str); + } +} + sub encode($$;$) { my ($name, $string, $check) = @_; @@ -147,8 +168,12 @@ require Carp; Carp::croak(Unknown encoding '$name'); } + $string = _ebcdic_utf8($string) if $ON_EBCDIC; my $octets = $enc-encode($string,$check); - $_[1] = $string if $check and !($check LEAVE_SRC()); + if ($check and !($check LEAVE_SRC()) ){ + $string = _utf8_ebcdic($string); + $_[1] = $string; + } return $octets; } @@ -164,6 +189,7 @@ Carp::croak(Unknown encoding '$name'); } my $string = $enc-decode($octets,$check); + $string = _utf8_ebcdic($string) if $ON_EBCDIC; $_[1] = $octets if $check and !($check LEAVE_SRC()); return $string; }
[Encode] 2.12 Released!
Porters, I am pleased to release Encode Version 2.12 as follows; =head1 Availability http://www.dan.co.jp/~dankogai/cpan/Encode-2.12.tar.gz and CPAN near you. =head1 Highlight You can finally use coderef to CHECK. coderef for CHECK As of Encode 2.12 CHECK can also be a code reference which takes the ord value of unmapped caharacter as an argument and returns a string that represents the fallback character. For instance, $ascii = encode(ascii, $utf8, sub{ sprintf U+%04X, shift }); Acts like FB_PERLQQ but U+ is used instead of \x{}. =head1 Changes $Revision: 2.12 $ $Date: 2005/09/08 14:17:17 $ ! Encode.xs Encode.pm t/fallback.t Now accepts coderef for CHECK! ! ucm/8859-7.ucm Updated to newer version at unicode.org http://rt.cpan.org/NoAuth/Bug.html?id=14222 ! lib/Encode/Supported.pod More POD typo fixed. [EMAIL PROTECTED] ! encoding.pm More POD typo leftover fixed. Message-Id: [EMAIL PROTECTED] =head1 Signature Dan the Encode Maintainer
Re: [Encode] 2.12 Released!
On Sep 08, 2005, at 23:34 , Sastry wrote: Hi Dan Please check my previous mail on Encode problem on EBCDIC. Did you apply the patch in this new Version?(Seems like that is broken on EBCDIC platform as I happened to test on z/OS) I wil be glad if you can reply me for the previous mail at the earliest! Ouch. Crisscrossed. I checked AFTER I've subscribed the patch. I just want to make sure you are talking about the one below; From: [EMAIL PROTECTED] Subject: Re: Encode on EBCDIC patch( Doesn't Work) Date: September 08, 2005 22:14:35 JST To: [EMAIL PROTECTED] Cc: perl5-porters@perl.org Reply-To: [EMAIL PROTECTED] Message-Id: [EMAIL PROTECTED] As for the upgrade the 2.12 DOES NOT contain my ad-hoc workaround patch. I'm not going to ship anything like that without tests. Dan the Encode Maintainer
Re: RFC - eliminate discrete arenaroots, mentoring
Nicholas Clark wrote: Scrub my previous message. It was incorrect. On Tue, Sep 06, 2005 at 11:40:12AM -0600, Jim Cromie wrote: t/op/sprintf..FAILED at test 239 @@ -9101,11 +9166,9 @@ } if (!asterisk) - { if( *q == '0' ) fill = *q++; EXPECT_NUMBER(q, width); - } if (vectorize) { if (vectorarg) { You didn't want to do that. :-) Nicholas Clark Eww, no I didnt. looks like I resync'd without taking a snapshot 1st, so ended up diffing out that change. extracting the lesson; you either blamelogged sprintf.t to find the failing test, then found 25171 as last touch, or you last-50'd sv.c, found the sprintf.t change, then maybe noted the the date and touched-file overlap, then the rogue chunk in my patch. thanks for stepping in where my brain turned off. now it passes all tests, threaded unthreaded attached diff-on-diff is smallest way to send correction. I dont suppose Im done though :-( Thus far, Im unable to smoke current with this patch - Im having issues getting 'make regen' to run after the pfile is applied, and consequently teh compile fails with stuff like: sv.c:8451: error: `PL_body_roots' undeclared (first use in this function) sv.c: In function `Perl_sv_dup': sv.c:10500: error: `PL_body_roots' undeclared (first use in this function) sv.c:10501: error: `PL_body_arenaroots' undeclared (first use in this function) sv.c: In function `perl_clone': sv.c:11355: error: `PL_body_arenaroots' undeclared (first use in this function) sv.c:11356: error: `PL_body_roots' undeclared (first use in this function) make: *** [sv.o] Error 1 Unable to make anything but miniperl in this configuration Any tips welcome. --- diff.arena-4-pub2005-09-06 10:47:36.0 -0600 +++ diff.arena-4-pub-fix2005-09-07 20:19:34.0 -0600 @@ -609,18 +609,6 @@ break; } -@@ -9101,11 +9166,9 @@ - } - - if (!asterisk) -- { - if( *q == '0' ) - fill = *q++; - EXPECT_NUMBER(q, width); -- } - - if (vectorize) { - if (vectorarg) { @@ -10153,7 +10216,7 @@ # define PTR_TABLE_HASH(ptr) (PTR2UV(ptr) 2) #endif
Re: RFC - eliminate discrete arenaroots, mentoring
On Thu, Sep 08, 2005 at 08:54:12AM -0600, Jim Cromie wrote: extracting the lesson; you either blamelogged sprintf.t to find the failing test, then found 25171 as last touch, or you last-50'd sv.c, found the sprintf.t change, then maybe noted the the date and touched-file overlap, then the rogue chunk in my patch. thanks for stepping in where my brain turned off. No, simpler than that. I read my way through your patch, wondering what each hunk did. That was the first non-innocent hunk, and I've read enough of the sprintf code in sv.c to realise it was there without needing to check the line numbers. Thus far, Im unable to smoke current with this patch - Im having issues getting 'make regen' to run after the pfile is applied, and consequently teh compile fails with stuff like: sv.c:8451: error: `PL_body_roots' undeclared (first use in this function) sv.c: In function `Perl_sv_dup': sv.c:10500: error: `PL_body_roots' undeclared (first use in this function) sv.c:10501: error: `PL_body_arenaroots' undeclared (first use in this function) sv.c: In function `perl_clone': sv.c:11355: error: `PL_body_arenaroots' undeclared (first use in this function) sv.c:11356: error: `PL_body_roots' undeclared (first use in this function) make: *** [sv.o] Error 1 Unable to make anything but miniperl in this configuration Any tips welcome. I didn't have a problem with doing perl regen.pl after applying your patch, then re-running make. So I don't know what to suggest. Nicholas Clark
[perl #37110] compiling perl 5.8.7 for win32 using free microsoft tools
# New Ticket Created by Werner Bochtler # Please include the string: [perl #37110] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37110 I've tried to compile perl 5.8.7 using the free tools from Microsoft as described in the README.win32. The new platform SDK for WinXP SP2 available from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm seems not to contain the subdirectory SRC as described in README.win32. - setargv.obj can't be built. BTW, compiling using the Microsoft Visual C++ included in Visual Studio .NET 2003 does work without any problems. Many thanks in advance. Best regards, Werner Bochtler
[perl #37108] win32sck.c problem in perl 5.8.7 32 using BCC 5.5.1
# New Ticket Created by Werner Bochtler # Please include the string: [perl #37108] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37108 The compilation of perl 5.8.7 for Win32 using BCC 5.5.1 fails with the following error: ... ilink32 -Tpe -ap -Lc:\apps\win\perl\5.8.7\lib\MSWin32-x86-multi-thread\CORE -LC:\apps\win\borland\bcc55\lib -Gn \ @c:\Temp\mk00022a Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland Error: Unresolved external 'WSCEnumProtocols' referenced from C:\TEMP\PERL-5.8.7 \WIN32\MINI\WIN32SCK.OBJ Error: Unresolved external 'WSASocketA' referenced from C:\TEMP\PERL-5.8.7\WIN32 \MINI\WIN32SCK.OBJ dmake.exe: Error code 2, while making '..\miniperl.exe' Workaround: Replace the file win32sck.c with the version from Perl 5.8.5 Remark: Compiling with VC does not cause any problems with the new version of win32sck.c. Best regards, Werner Bochtler
Re: RFC - eliminate discrete arenaroots, mentoring
Nicholas Clark wrote: On Thu, Sep 08, 2005 at 08:54:12AM -0600, Jim Cromie wrote: Thus far, Im unable to smoke current with this patch - Im having issues getting 'make regen' to run after the pfile is applied, and consequently teh compile fails with stuff like: sv.c:8451: error: `PL_body_roots' undeclared (first use in this function) sv.c: In function `Perl_sv_dup': sv.c:10500: error: `PL_body_roots' undeclared (first use in this function) sv.c:10501: error: `PL_body_arenaroots' undeclared (first use in this function) sv.c: In function `perl_clone': sv.c:11355: error: `PL_body_arenaroots' undeclared (first use in this function) sv.c:11356: error: `PL_body_roots' undeclared (first use in this function) make: *** [sv.o] Error 1 Unable to make anything but miniperl in this configuration Any tips welcome. I didn't have a problem with doing perl regen.pl after applying your patch, then re-running make. So I don't know what to suggest. Nicholas Clark I had no trouble doing it manually, but getting configsmoke and/or smokecurrent to do it was not working for me. I was hoping to be able to say 'works for all these smoke-configs', alas no.
[perl #37110] compiling perl 5.8.7 for win32 using free microsoft tools
Thanks for the bug report. Are you sure that you installed the correct SDK components? I believe that the Core and MDAC components are all that is required, but perhaps something else is too. Try installing other components if you haven't already installed them all and let us know if some other component provides the missing files. Note that the PSDK is a constantly moving target, and so are the links to it. (I should probably update the instructions to simply direct users to the MS download website and tell them what to search for.) The latest version, suitable for XP and 2003, is the 2003 SP1 version currently available here: http://www.microsoft.com/downloads/details.aspx?familyid=EBA0128F-A770-45F1-86F3-7AB010B398A3displaylang=en I have this installed at the moment, and it definitely contains the required src files. (I'm surprised that you say the XPSP2 version doesn't, because I thought I'd successfully used that one in the past myself.)
Re: RFC - eliminate discrete arenaroots, mentoring
Op een mooie zomerdag (Thursday 08 September 2005 17:56),schreef Jim Cromie: Nicholas Clark wrote: [snip] I didn't have a problem with doing perl regen.pl after applying your patch, then re-running make. So I don't know what to suggest. Nicholas Clark I had no trouble doing it manually, but getting configsmoke and/or smokecurrent to do it was not working for me. I was hoping to be able to say 'works for all these smoke-configs', alas no. What did you do? The way to fully test your patch is described in Test::Smoke::FAQ (or just FAQ for 1.19). After all patches are applied 'perl regen.pl' is called. Let me know if you still have problems with this. HTH + Good luck, Abe -- (Whoo hoo! For this week only, I understand Perl's exception handling. By next week it will all have faded again.) It's like a dream really. There was a RUNOPS level and a setjmp, and I remember being chased along a tunnel, and there was a smell of roses, and ... wait no, it's all fading it's gone now. -- Dave Mitchell on p5p @ 2004-08-10