Grokbase
x

pe...@perl.org (pe...@perl.org)

Profile | Posts (366)

User Information

Display Name:pe...@perl.org
Partial Email Address:pe...@perl.org
Posts:
366 total
366 in Perl 5 Porters

5 Most Recent

All Posts
1) pe...@perl.org Status
paperclip | +1 vote
The message contains Unicode characters and has been sent as a binary attachment....
Perl 5 Porters
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
The message contains Unicode characters and has been sent as a binary attachment.

Attachment: data.zip
2) pe...@perl.org [perl #18820] Re: C<use Test::More;> causes C<BEGIN> blocks to be skipped.
| +1 vote
# New Ticket Created by Michael G Schwern # Please include the string: [perl #18820] # in the...
Perl 5 Porters
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
# New Ticket Created by  Michael G Schwern 
# Please include the string:  [perl #18820]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18820 >


On Mon, Dec 02, 2002 at 11:34:20AM +0100, Abigail wrote:
>     #!/usr/bin/perl
>
>     use strict;
>     use warnings;
>
>     use Test::More tests => 1;
>
>     BEGIN {
>         use_ok "Carp";
>         print "BEGIN run\n";
>     }
>     __END__
>
> This will give the expected:
>
>     1..1
>     ok 1 - use Carp;
>     BEGIN run
>
>
> But if omit the 'test => 1' arguments to the 'use Test::More' statement,
> no output at all is generated - the BEGIN block isn't run.

The BEGIN block is run.  Your print statement is never reached because
use_ok() dies since there was no plan.  Remove the BEGIN block and you'll
see:

$ perl -w ~/tmp/bug.plx
You tried to run a test without a plan! Gotta have a plan. at /usr/local/share/perl/5.6.1/Test/More.pm line 691
# Looks like your test died before it could output anything.

In the BEGIN version, something is funny inside Test::Builder's __DIE__
handler. The handler is just there to figure out if its inside an eval BLOCK
and if it should consider the death to be a real death or a trapped one.
Test::Builder walks up the caller() stack looking for a subroutine of
'(eval)' ($^S has proven unreliable across perl versions).  For some reason,
caller() considers us to be inside an eval (which I suppose makes sense).
Here's the full caller() stack plus $^S tacked on the end.

1 Test::Builder lib/Test/Builder.pm 331 Carp::croak 1 undef undef undef 0 UUUUUUUUUUUU undef
2 Test::More lib/Test/More.pm 726 Test::Builder::ok 1 0 undef undef 0 UUUUUUUUUUUU undef
3 main /home/schwern/tmp/bug.plx 6 Test::More::use_ok 1 undef undef undef 0 UUUUUUUUUUUU undef
4 main /home/schwern/tmp/bug.plx 8 main::BEGIN 1 0 undef undef 0 UUUUUUUUUUUU undef
5 main /home/schwern/tmp/bug.plx 8 (eval) 0 0 undef undef 0 UUUUUUUUUUUU undef

I don't know if that's right or not, but it means Test::Builder will supress
its ending output (the "# Looks like your test died..." part) so that part
is explained.  But the "You tried to run a test without a plan" part, which
triggers the $SIG{__DIE__}, comes from Carp::croak.  There's nothing in the
__DIE__ handler which should supress that.  STDERR is open, "print STDERR"
works inside the __DIE__ handler but die() does not.

Looks like an internals glitch.


--

Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/
Perl Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One
Any sufficiently encapsulated hack is no longer a hack.
3) pe...@perl.org [perl #18819] perl 5.8 bug report
| +1 vote
# New Ticket Created by hpulley@mks.com # Please include the string: [perl #18819] # in the subject...
Perl 5 Porters
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
# New Ticket Created by  [email protected: hp...@mks.com] 
# Please include the string:  [perl #18819]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18819 >


I am looking at fixing this bug and will send a patch if I'm successful but in
the meantime, I thought I would send this report.

The following code hangs after the output of one line with Perl 5.6 and 5.8.  
I've tried ActivePerl 5.6 and 5.8 and our (MKS Toolkit's) Perl 5.6 and 5.8 and
both exhibit the same behaviour.  Both ActivePerl and the MKS Port worked fine
at 5.0.5.

 $procName="This is a test on a Win platform #  jj # - - __ _ * * * # # #";
while ($procName =~ /\G([\w]+)|([\s]+)|([^\w\x]+)/g)
    {
if (defined $1) { print " ONE $1 \n";}
  if (defined $3)
     {
      print "THREE $3 \n";
     }
}

Output from ActivePerl 5.8's perlbug -d:
---
Flags:
    category=
    severity=
---
Site configuration information for perl v5.8.0:

Configured by ActiveState at Fri Nov  8 00:53:50 2002.

Summary of my perl5 (revision 5 version 8 subversion 0) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cl', ccflags ='-nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
    optimize='-MD -DNDEBUG -O1',
    cppflags='-DWIN32'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -release -libpath:"C:/Perl\lib\CORE" -machine:x86'
libpth="C:\Microsoft Visual Studio\VC98\mfc\lib" "C:\Microsoft Visual Studio\VC98\lib" "C:\Perl\lib\CORE"
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib
perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
    gnulibc_version='undef'
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release -libpath:"C:/Perl\lib\CORE" -machine:x86'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY

---
@INC for perl v5.8.0:
    C:/Perl/lib
    C:/Perl/site/lib
    .

---
Environment for perl v5.8.0:
    HOME=c:/Documents and Settings/hpulley
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
PATH=C:\Perl\bin\;C:\Program Files\Intel\ICID;C:\Program Files\Intel\EDB;C:\Program Files\Intel\ISelect\Bin6;C:\Program Files\Intel\Compiler60\IA32\Bin;C:\Program Files\MKS\IntegrityClient\bin;C:\PROGRA~1\MKSTOO~1\bin;C:\PROGRA~1\MKSTOO~1\bin\X11;C:\PROGRA~1\MKSTOO~1\mksnt;c:\mks\mkssi;c:\mks\mksnt;c:\mks\bin;c:\mks\bin\x11;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\wbem;c:\telnet\slnet;C:\PROGRA~1\Vision;C:\PROGRA~1\Vision\SYSTEM;C:\PROGRA~1\COMMON~1\Vision;C:\Program Files\MKS\IntegrityClient\bin;C:\msdev\Tools\WinNT;C:\msdev\MSDev98\Bin;C:\msdev\Tools;C:\Microsoft Visual Studio\VC98\bin;c:/MASM611/BIN;C:/rd/src/qa/bin;C:/rd/src/qa/bin/wntiapx
    PERL_BADLANG (unset)
    SHELL=C:/Program Files/MKSTOO~1/mksnt/sh.exe

Harry Pulley
[email protected: hp...@mks.com]
4) pe...@perl.org [perl #18814] Getopt::Long is not getopt_long compatible
| +1 vote
# New Ticket Created by raf@raf.org # Please include the string: [perl #18814] # in the subject...
Perl 5 Porters
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
# New Ticket Created by  [email protected: r...@raf.org] 
# Please include the string:  [perl #18814]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18814 >



This is a bug report for perl from [email protected: r...@raf.org],
generated with the help of perlbug 1.33 running under perl v5.6.1.


-----------------------------------------------------------------
[Please enter your report here]

greetings,

perldoc Getopt::Long says (in Configuring Getopt::Long):

> gnu_getopt This is a short way of setting "gnu_compat"
> "bundling" "permute" "no_getopt_compat". With
> "gnu_getopt", command line handling should be
> fully compatible with GNU getopt_long().

but it also says (in Getting Started with Getopt::Long):

> This module also supports single-character options and bundling.
> In this case, the options are restricted to alphabetic characters
>  only, and the characters "?" and "-".

which means that it is not compatible with getopt_long() since getopt_long()
does not impose arbitrary restrictions on which characters may be used as
option letters. the only characters that can't be used are ':' and '?'
because they clash with error codes.

the only characters that i think should be disallowed by Getopt::Long are
|!+=: since, according to the doco (Summary of Option Specifications), these
characters terminate option names and aliases and have special meanings.
according to the code, ~ needs to be added to the list.

example:

>  #!/usr/bin/perl -w
>  use strict;
>  use Getopt::Long;
>  my %opt;
>  GetOptions \%opt, qw(.|stop);
>  print "stop\n" if exists $opt{'.'};

this code outputs:

>  Error in option spec: ".|stop"

it should do:

$ ./hmm -.
stop

i can't see how this can be considered an error.

here's a patch. i haven't done thorough testing on this patch.
and i don't know if it breaks anything. but it's a start.

--- Long.pm.orig Tue Apr  2 03:28:01 2002
+++ Long.pm Tue Dec  3 00:38:32 2002
@@ -308,8 +308,8 @@
      next;
  }

- # Match option spec. Allow '?' as an alias only.
- if ( $opt !~ /^((\w+[-\w]*)(\|(\?|\w[-\w]*)?)*)?([!~+]|[=:][infse][@%]?)?$/ ) {
+ # Match option spec.
+ if ( $opt !~ /^(([^-|!~+=:][^|!~+=:]*)(\|([^-|!~+=:][^|!~+=:]*)?)*)?([!~+]|[=:][infse][@%]?)?$/ ) {
      $error .= "Error in option spec: \"$opt\"\n";
      next;
  }
@@ -1090,9 +1090,7 @@
Getopt::Long is the Perl5 successor of C<newgetopt.pl>. This was
the first Perl module that provided support for handling the new style
of command line options, hence the name Getopt::Long. This module
-also supports single-character options and bundling. In this case, the
-options are restricted to alphabetic characters only, and the
-characters C<?> and C<->.
+also supports single-character options and bundling.

To use Getopt::Long from a Perl program, you must include the
following line in your Perl program:

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=low
---
Site configuration information for perl v5.6.1:

Configured by bhcompile at Mon Apr  1 12:22:19 EST 2002.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.17-0.13smp, archname=i386-linux
uname='linux daffy.perf.redhat.com 2.4.17-0.13smp #1 smp fri feb 1 10:30:48 est 2002 i686 unknown '
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Uusethreads -Uuseithreads -Uuselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm'
    hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
    optimize='-O2 -march=i386 -mcpu=i686',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.2 2.96-109)', 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=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.6.1:
    /usr/lib/perl5/5.6.1/i386-linux
    /usr/lib/perl5/5.6.1
    /usr/lib/perl5/site_perl/5.6.1/i386-linux
    /usr/lib/perl5/site_perl/5.6.1
    /usr/lib/perl5/site_perl/5.6.0/i386-linux
    /usr/lib/perl5/site_perl/5.6.0
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.6.1/i386-linux
    /usr/lib/perl5/vendor_perl/5.6.1
    /usr/lib/perl5/vendor_perl
    .

---
Environment for perl v5.6.1:
    HOME=/home/raf
    LANG=en_US.iso885915
    LANGUAGE (unset)
    LC_COLLATE=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
PATH=/home/raf/bin:/home/raf/bin/site/eccles:/opt/acroread/bin:/opt/j2se/bin:/opt/jukebox/bin:/opt/majordomo/bin:/opt/office:/opt/quake:/opt/real:/opt/weblog:/usr/local/bin:/usr/X11R6/bin:/usr/kerberos/bin:/usr/bin:/bin:/usr/sbin:/sbin:.
    PERL_BADLANG (unset)
    SHELL=zsh
5) pe...@perl.org [perl #18812] Getopt::Long no_getopt_compat does nothing
| +1 vote
# New Ticket Created by raf@raf.org # Please include the string: [perl #18812] # in the subject...
Perl 5 Porters
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
# New Ticket Created by  [email protected: r...@raf.org] 
# Please include the string:  [perl #18812]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18812 >



This is a bug report for perl from [email protected: r...@raf.org],
generated with the help of perlbug 1.33 running under perl v5.6.1.


-----------------------------------------------------------------
[Please enter your report here]

greetings,

the Getopt::Long perldoc says (in Configuring Getopt::Long):

  getopt_compat
    Allow "+" to start options.  Default is
    enabled unless environment variable
    POSIXLY_CORRECT has been set, in which case
    "getopt_compat" is disabled.

while the default behaviour agrees with the doco, trying
to turn getopt_compat on or off with the Configure() function
does almost nothing. arguments beginning with "+" are still
seen as options when 'no_getopt_compat' is passed to Configure.

example:

  #!/usr/bin/perl -w
  use strict;
  use Getopt::Long;
  Getopt::Long::Configure('no_getopt_compat');
  my %opt;
  GetOptions \%opt, qw(a|aaa b|bbb c|ccc);
  print "@ARGV\n";

this is what happens when it gets an argument starting with "+":

$ ./hmm +d
Unknown option: d

when it should do this:

$ ./hmm +d
+d

the same bug applies to [no_]gnu_getopt as well.

here's a patch:

--- Long.pm.orig Tue Apr  2 03:28:01 2002
+++ Long.pm Mon Dec  2 23:42:47 2002
@@ -953,12 +953,14 @@
  }
  elsif ( $try eq 'getopt_compat' ) {
      $getopt_compat = $action;
+     $genprefix = $getopt_compat ? "(--|-|\\+)" : "(--|-)";
  }
  elsif ( $try eq 'gnu_getopt' ) {
      if ( $action ) {
   $gnu_compat = 1;
   $bundling = 1;
   $getopt_compat = 0;
+  $genprefix = "(--|-)";
   $permute = 1;
      }
  }

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=low
---
Site configuration information for perl v5.6.1:

Configured by bhcompile at Mon Apr  1 12:22:19 EST 2002.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.17-0.13smp, archname=i386-linux
uname='linux daffy.perf.redhat.com 2.4.17-0.13smp #1 smp fri feb 1 10:30:48 est 2002 i686 unknown '
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Uusethreads -Uuseithreads -Uuselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm'
    hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
    optimize='-O2 -march=i386 -mcpu=i686',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.2 2.96-109)', 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=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.6.1:
    /usr/lib/perl5/5.6.1/i386-linux
    /usr/lib/perl5/5.6.1
    /usr/lib/perl5/site_perl/5.6.1/i386-linux
    /usr/lib/perl5/site_perl/5.6.1
    /usr/lib/perl5/site_perl/5.6.0/i386-linux
    /usr/lib/perl5/site_perl/5.6.0
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.6.1/i386-linux
    /usr/lib/perl5/vendor_perl/5.6.1
    /usr/lib/perl5/vendor_perl
    .

---
Environment for perl v5.6.1:
    HOME=/home/raf
    LANG=en_US.iso885915
    LANGUAGE (unset)
    LC_COLLATE=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
PATH=/home/raf/bin:/home/raf/bin/site/eccles:/opt/acroread/bin:/opt/j2se/bin:/opt/jukebox/bin:/opt/majordomo/bin:/opt/office:/opt/quake:/opt/real:/opt/weblog:/usr/local/bin:/usr/X11R6/bin:/usr/kerberos/bin:/usr/bin:/bin:/usr/sbin:/sbin:.
    PERL_BADLANG (unset)
    SHELL=zsh

spacer
Profile | Posts (366)
Home > People > pe...@perl.org