develooper Front page | perl.perl5.porters | Postings from December 2009

[perl #71078] Smart match against @_ gives false negatives

Thread Next
From:
Anno Siegel
Date:
December 7, 2009 02:22
Subject:
[perl #71078] Smart match against @_ gives false negatives
Message ID:
rt-3.6.HEAD-12359-1260136602-1171.71078-75-0@perl.org
# New Ticket Created by  Anno Siegel 
# Please include the string:  [perl #71078]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=71078 >


This is a bug report for perl from anno@radom.local,
generated with the help of perlbug 1.39 running under perl 5.11.2.


-----------------------------------------------------------------
[Please describe your issue here]


There seems to be a problem when undefined values are specified in a
sub call and the sub smart-matches @_ against something.  For instance,

    sub check { [@_] ~~ \ @_ ? 'good' : 'bad' }

should always return 'good', but

    check(1, 2, 'lala'); # good
    check(1, 2, undef);  # bad
    check(undef);        # bad

while

   check(my $x);         # good again

Something isn't as it should be.  I have checked the behavior with
bleadperl as shown below.

Regards, Anno


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
This perlbug was built using Perl 5.10.1 - Mon Nov  9 23:54:32 CET 2009
It is being executed now by  Perl 5.11.2 - Sun Dec  6 21:52:21 CET 2009.

Site configuration information for perl 5.11.2:

Configured by anno at Sun Dec  6 21:52:21 CET 2009.

Summary of my perl5 (revision 5 version 11 subversion 2 patch v5.11.2-114-g077f834) configuration:
  Snapshot of: 077f834239e40e0523e428946baaf95eaec43724
  Platform:
    osname=darwin, osvers=10.2.0, archname=darwin-2level
    uname='darwin radom.local 10.2.0 darwin kernel version 10.2.0: tue nov 3 10:37:10 pst 2009; root:xnu-1486.2.11~1release_i386 i386 '
    config_args='-des -Dusemymalloc -Dusedevel -DDEBUGGING -Accflags=-DPERL_DEBUGGING_MSTATS -Dprefix=/usr/local/ports/bleadperl/install -Uversiononly'
    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=y, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -DPERL_DEBUGGING_MSTATS -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include',
    optimize='-O3 -g',
    cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -DPERL_DEBUGGING_MSTATS -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include'
    ccversion='', gccversion='4.2.1 (Apple Inc. build 5646) (dot 1)', 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=-ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=/usr/lib/libc.dylib, 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.11.2:
    /Users/anno/lib/perl5
    /usr/local/ports/bleadperl/install/lib/site_perl/5.11.2/darwin-2level
    /usr/local/ports/bleadperl/install/lib/site_perl/5.11.2
    /usr/local/ports/bleadperl/install/lib/5.11.2/darwin-2level
    /usr/local/ports/bleadperl/install/lib/5.11.2
    /usr/local/ports/bleadperl/install/lib/site_perl/5.11.1/darwin-2level
    /usr/local/ports/bleadperl/install/lib/site_perl/5.11.1
    /usr/local/ports/bleadperl/install/lib/site_perl
    .

---
Environment for perl 5.11.2:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/anno
    LANG=de_DE.UTF-8
    LANGUAGE (unset)
    LC_CTYPE=de_DE.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/Users/anno/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin:/usr/local/pgsql/bin
    PERL5LIB=/Users/anno/lib/perl5
    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