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

Owner: Nobody
Requestors: sprout <sprout [at] cpan.org>
Cc:
AdminCc:

Operating System: All
PatchStatus: (no value)
Severity: low
Type:
Perl Version: 5.10.0
Fixed In:
  • 5.21.3
  • 5.22.0



Subject: method { expression } { $foo => "bar" }
Date: Fri, 26 Oct 2007 22:25:52 -0700
To: perlbug [...] perl.org
From: Father Chrysostomos <sprout [...] cpan.org>
Download (untitled) / with headers
text/plain 2.8k
I can call a method on the result of an expression with indirect object syntax, giving it a hash ref, like this: method { some(complex() + 'expression' } { foo => 'bar' } But, if I change 'foo' to $foo, I get a syntax error message: syntax error at -e line 1, near "} { " This occurs also in perl 5.8.8. --- Flags: category=core severity=low --- This perlbug was built using Perl 5.10.0 - Mon Sep 24 10:10:11 PDT 2007 It is being executed now by Perl 5.10.0 - Sat Oct 6 16:48:24 PDT 2007. Site configuration information for perl 5.10.0: Configured by neo at Sat Oct 6 16:48:24 PDT 2007. Summary of my perl5 (revision 5 version 10 subversion 0 patch 32056) configuration: Platform: osname=darwin, osvers=8.8.0, archname=darwin-2level uname='darwin treebeard.local 8.8.0 darwin kernel version 8.8.0: fri sep 8 17:18:57 pdt 2006; root:xnu-792.12.6.obj~1release_ppc power macintosh powerpc ' config_args='-de' hint=recommended, useposix=true, d_sigaction=define 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-common -DPERL_DARWIN -no-cpp-precomp - fno-strict-aliasing -pipe -I/usr/local/include', optimize='-O3', cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp- precomp -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.0.0 20041026 (Apple Computer, Inc. build 4061)', gccosandvers='darwin8' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 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='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -L/usr/ local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lc perllibs=-ldl -lm -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' Locally applied patches: DEVEL --- @INC for perl 5.10.0: /usr/local/lib/perl5/5.9.5/darwin-2level /usr/local/lib/perl5/5.9.5 /usr/local/lib/perl5/site_perl/5.9.5/darwin-2level /usr/local/lib/perl5/site_perl/5.9.5 . --- Environment for perl 5.10.0: DYLD_LIBRARY_PATH (unset) HOME=/Users/neo LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/TeX/bin/powerpc- darwin6.8:/usr/local/bin PERL_BADLANG (unset) SHELL=/bin/bash
Subject: Re: [perl #46947] method { expression } { $foo => "bar" }
Date: Sun, 28 Oct 2007 23:28:03 +0100
To: perl5-porters [...] perl.org
From: "Rafael Garcia-Suarez" <rgarciasuarez [...] gmail.com>
Download (untitled) / with headers
text/plain 513b
On 27/10/2007, via RT Father Chrysostomos <perlbug-followup@perl.org> wrote: Show quoted text
> I can call a method on the result of an expression with indirect > object syntax, giving it a hash ref, like this: > > method { some(complex() + 'expression' } { foo => 'bar' } > > But, if I change 'foo' to $foo, I get a syntax error message: > syntax error at -e line 1, near "} { "
I think that's one of those cases where one needs to add a + in front of the hashref to disambiguate it. Not much possible to change it actually...
RT-Send-CC: perl5-porters [...] perl.org
Fixed in b5b6210a. -- Father Chrysostomos
Subject: Your ticket against Perl 5 has been resolved
Download (untitled) / with headers
text/plain 222b
Thanks for submitting this ticket The issue should be resolved with the release today of Perl v5.22. If you find that the problem persists, feel free to reopen this ticket -- Karl Williamson for the Perl 5 porters team


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