Skip Menu |
Report information
Id: 47363
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors:
Cc:
AdminCc:

Operating System: darwin
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.8.8
Fixed In: (no value)



Subject: \@ prototypes and anonymous scalar refs
Date: Sun, 11 Nov 2007 17:44:46 -0800
To: perlbug [...] perl.org
From: webmasters [...] ctosonline.org
Download (untitled) / with headers
text/plain 3.3k
(Assume these examples all begin with 'use Data::Dumper'.) This doesn't cause a parse error. Instead, it passes a reference to an anon scalar to &foo: sub foo(\@) { print Dumper @_ }; foo((@foo)) as does this: sub foo(\@) { print Dumper @_ }; foo+(@foo) But these three work fine: sub foo(\@) { print Dumper @_ }; foo+@foo sub foo(\@) { print Dumper @_ }; foo(+@foo) sub foo(\@) { print Dumper @_ }; foo(+ +@foo) --- Flags: category=core severity=low --- Site configuration information for perl v5.8.8: Configured by root at Sun Sep 23 19:05:56 PDT 2007. Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=darwin, osvers=9.0, archname=darwin-thread-multi-2level uname='darwin omen.apple.com 9.0 darwin kernel version 9.0.0b5: mon sep 10 17:17:11 pdt 2007; root:xnu-1166.6~1release_ppc power macintosh ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags=- Dman3ext=3pm -Duseithreads -Duseshrplib' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-arch i386 -arch ppc -g -pipe -fno-common - DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after- statement -I/usr/local/include', optimize='-O3', cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no- cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/ local/include' ccversion='', gccversion='4.0.1 (Apple Inc. build 5465)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 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, prototype=define Linker and Libraries: ld='cc -mmacosx-version-min=10.5', ldflags ='-arch i386 -arch ppc -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-arch i386 -arch ppc -bundle - undefined dynamic_lookup -L/usr/local/lib' Locally applied patches: --- @INC for perl v5.8.8: /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /Network/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl/5.8.1 . --- Environment for perl v5.8.8: DYLD_LIBRARY_PATH (unset) HOME=/Users/sprout LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/pgsql/bin:/usr/TeX/ bin/powerpc-darwin6.8/:/usr/local/bin PERL_BADLANG (unset) SHELL=/bin/bash
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 548b
On Sun Nov 11 17:45:29 2007, webmasters ctosonline.org wrote: Show quoted text
> (Assume these examples all begin with 'use Data::Dumper'.) > > This doesn't cause a parse error. Instead, it passes a reference to an > anon scalar to &foo: > sub foo(\@) { print Dumper @_ }; foo((@foo)) > as does this: > sub foo(\@) { print Dumper @_ }; foo+(@foo) > But these three work fine: > sub foo(\@) { print Dumper @_ }; foo+@foo > sub foo(\@) { print Dumper @_ }; foo(+@foo) > sub foo(\@) { print Dumper @_ }; foo(+ +@foo)
Fixed in 0c46edc. -- Father Chrysostomos


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org