develooper Front page | perl.perl5.porters | Postings from April 2000

[ID 20000413.002] prototype for optional coderef parameter

Thread Next
From:
operator
Date:
April 13, 2000 06:43
Subject:
[ID 20000413.002] prototype for optional coderef parameter
Message ID:
200004131343.PAA21960@periszrz.zrz.TU-Berlin.DE

This is a bug report for perl from siegel@zrz.tu-berlin.de,
generated with the help of perlbug 1.28 running under perl v5.6.0.


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


Please watch this:

perl -e 'sub foo (;&) {} foo {};'
Type of arg 1 to main::foo must be block (not single ref constructor) at -e line 1, near "};"

Calling foo with a bare block should be possible, at least perlsub doesn't
say otherwise.  The error goes away when you make the coderef parameter
required, changing "(;&)" to "(&)".

The bug, if it is a bug, was present in Perl 5.5 as well, though the
message said "(not scalar ref constructor)" instead of "...single...".

Regards, Anno

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

Configured by rrdl4000 at Thu Apr  6 10:04:24 MET DST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos periszrz 5.6 generic_105181-04 sun4u sparc sunw,ultra-1 '
    config_args='-Dprefix=/usr/local/perl-5.6.0 -Dcc=gcc -Uinstallusrbinperl'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.8.1
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib -L/usr/gnu/lib '
    libpth=/usr/local/lib /usr/gnu/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib -L/usr/gnu/lib'

Locally applied patches:
    

---
@INC for perl v5.6.0:
    /usr/local/perl-5.6.0/lib/5.6.0/sun4-solaris
    /usr/local/perl-5.6.0/lib/5.6.0
    /usr/local/perl-5.6.0/lib/site_perl/5.6.0/sun4-solaris
    /usr/local/perl-5.6.0/lib/site_perl/5.6.0
    /usr/local/perl-5.6.0/lib/site_perl
    .

---
Environment for perl v5.6.0:
    HOME=/
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/sbin:/usr/bin:/usr/X/bin:/usr/ccs/bin:/usr/ucb:/usr/local/bin
    PERL_BADLANG (unset)
    SHELL=/sbin/sh

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