Skip Menu |
 
Report information
Id: 3270
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: abigail [at] arenanetworks.com
Cc:
AdminCc:

Operating System: Solaris
PatchStatus: (no value)
Severity: medium
Type:
  • core
  • OO/ISA/MRO/overload
Perl Version: 5.6.0
Fixed In: (no value)



Date: 19 May 2000 18:38:10 -0000
From: abigail [...] arenanetworks.com
To: perlbug [...] perl.com
Subject: No check whether operators are overloaded to lvalue functions.
Download (untitled) / with headers
text/plain 3.4k
This is a bug report for perl from abigail@arena-i.com, generated with the help of perlbug 1.28 running under perl v5.6.0. ----------------------------------------------------------------- [Please enter your report here] #!/opt/perl/bin/perl no warnings; use overload '.' => \˙ sub dot : lvalue {my ($obj, $method) = @_; $obj -> {$method};} my $o = bless {} => "main"; $o.foo = "bar"; __END__ This doesn't compile with the error: Can't modify concatenation (.) in scalar assignment at ./overloaded.pl line 9, near ""bar";" Execution of ./overloaded.pl aborted due to compilation errors. However, the overloaded operator returns an lvalue, and hence the assignment ought to work. Abigail [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=medium --- This perlbug was built using Perl v5.6.0 - Thu Mar 23 19:51:19 EST 2000 It is being executed now by Perl v5.6.0 - Fri Mar 24 17:24:48 EST 2000. Site configuration information for perl v5.6.0: Configured by abigail at Fri Mar 24 17:24:48 EST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=solaris, osvers=2.7, archname=i86pc-solaris-64int uname='sunos newyork 5.7 generic_106542-07 i86pc i386 i86pc ' config_args='-d -Dprefix=/opt/perl -Uinstallusrbinperl -Doptimize=-g -Duse64bitint' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=define use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-g', gccversion=2.95.1 19990816 (release) cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include' ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, usemymalloc=y, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldb -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' Locally applied patches: --- @INC for perl v5.6.0: /home/abigail/Perl /home/abigail/Sybase /opt/perl/lib/5.6.0/i86pc-solaris-64int /opt/perl/lib/5.6.0 /opt/perl/lib/site_perl/5.6.0/i86pc-solaris-64int /opt/perl/lib/site_perl/5.6.0 /opt/perl/lib/site_perl . --- Environment for perl v5.6.0: HOME=/home/abigail LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH=/home/abigail/Lib:/usr/local/lib:/usr/lib:/lib:/usr/X11R6/lib LOGDIR (unset) PATH=/home/abigail/bin:/usr/local/bin:/usr/local/X11/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/games:/usr/ccs/bin:/usr/openwin/bin:/opt/Acrobat4/bin:/opt/cvs/bin:/opt/perl/bin PERL5LIB=/home/abigail/Perl:/home/abigail/Sybase PERLDIR=/opt/perl PERL_BADLANG (unset) SHELL=/usr/local/bin/bash
Date: Wed, 07 Jun 2000 15:54:57 +0200
From: Richard Foley <Richard.Foley [...] m.dasa.de>
Subject: [ID 20000519.008] No check whether operators are overloaded to lvalue functions.
To: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 3.4k
This is a bug report for perl from abigail@arena-i.com, generated with the help of perlbug 1.28 running under perl v5.6.0. ----------------------------------------------------------------- [Please enter your report here] #!/opt/perl/bin/perl no warnings; use overload '.' => \&dot; sub dot : lvalue {my ($obj, $method) = @_; $obj -> {$method};} my $o = bless {} => "main"; $o.foo = "bar"; __END__ This doesn't compile with the error: Can't modify concatenation (.) in scalar assignment at ./overloaded.pl line 9, near ""bar";" Execution of ./overloaded.pl aborted due to compilation errors. However, the overloaded operator returns an lvalue, and hence the assignment ought to work. Abigail [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=medium --- This perlbug was built using Perl v5.6.0 - Thu Mar 23 19:51:19 EST 2000 It is being executed now by Perl v5.6.0 - Fri Mar 24 17:24:48 EST 2000. Site configuration information for perl v5.6.0: Configured by abigail at Fri Mar 24 17:24:48 EST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=solaris, osvers=2.7, archname=i86pc-solaris-64int uname='sunos newyork 5.7 generic_106542-07 i86pc i386 i86pc ' config_args='-d -Dprefix=/opt/perl -Uinstallusrbinperl -Doptimize=-g -Duse64bitint' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=define use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-g', gccversion=2.95.1 19990816 (release) cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include' ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, usemymalloc=y, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldb -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' Locally applied patches: --- @INC for perl v5.6.0: /home/abigail/Perl /home/abigail/Sybase /opt/perl/lib/5.6.0/i86pc-solaris-64int /opt/perl/lib/5.6.0 /opt/perl/lib/site_perl/5.6.0/i86pc-solaris-64int /opt/perl/lib/site_perl/5.6.0 /opt/perl/lib/site_perl . --- Environment for perl v5.6.0: HOME=/home/abigail LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH=/home/abigail/Lib:/usr/local/lib:/usr/lib:/lib:/usr/X11R6/lib LOGDIR (unset) PATH=/home/abigail/bin:/usr/local/bin:/usr/local/X11/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/games:/usr/ccs/bin:/usr/openwin/bin:/opt/Acrobat4/bin:/opt/cvs/bin:/opt/perl/bin PERL5LIB=/home/abigail/Perl:/home/abigail/Sybase PERLDIR=/opt/perl PERL_BADLANG (unset) SHELL=/usr/local/bin/bash
Download (untitled) / with headers
text/plain 867b
On Fri May 19 04:35:48 2000, abigail@arenanetworks.com wrote: Show quoted text
> #!/opt/perl/bin/perl > > no warnings; > use overload '.' => \&dot; > sub dot : lvalue {my ($obj, $method) = @_; $obj -> {$method};} > my $o = bless {} => "main"; > > $o.foo = "bar"; > __END__ > > This doesn't compile with the error: > > Can't modify concatenation (.) in scalar assignment at > ./overloaded.pl > line 9, near ""bar";" > Execution of ./overloaded.pl aborted due to compilation errors. > > > However, the overloaded operator returns an lvalue, and hence the > assignment ought to work.
This is partially fixed by commit bf8fb5e. If the $o.foo is changed to ${\($o.foo)} *and* if the returned hash element already exists, it works. (I know, that barely fixes it at all, but it’s useful to have a trail explaining how it was fixed.)


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