develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #46581] perlop Document clarification

Thread Next
From:
Brian Fraser via RT
Date:
May 24, 2012 20:13
Subject:
[perl #46581] perlop Document clarification
Message ID:
rt-3.6.HEAD-7788-1337915607-640.46581-15-0@perl.org
On Sat Oct 20 13:47:25 2007, LAWalsh wrote:
> 
> This is a bug report for perl from perl-diddler@tlinx.org,
> generated with the help of perlbug 1.35 running under perl v5.8.8.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> On "perlop" manpage, under "Assignment Operators", it says:
> 
> "Assignment operators work as in C.  That is,
> 
>     $a += 2;
> 
> is equivalent to
> 
>     $a = $a + 2;
> 
> although without duplicating any side effects that dereferencing the
> lvalue might trigger, such as from tie().  ..."
> -----
> It might be more clear if the "although" continued:
> 
> "although without generating warnings or duplicating side effects that
> dereferencing the lvalue might trigger, such as modifying an lvalue
>    that
> starts with an undefined value or side effects caused by tie()."
> 
> The bit about "no warnings" when the lvalue starts with "undef" seems
> important enough to mention.  Eliminating warnings isn't the first
> thing I think of as a "side effect" of dereferencing an lvalue.
> 
> Linda W.
> 
> 
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
>     category=docs
>     severity=low
> ---
> Site configuration information for perl v5.8.8:
> 
> Configured by rurban at Sun Jul  8 19:08:44 GMT 2007.
> 
> Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
>   Platform:
>     osname=cygwin, osvers=1.5.24(0.15642), archname=cygwin-thread-
>    multi-64int
>     uname='cygwin_nt-5.1 reini 1.5.24(0.15642) 2007-01-31 10:57 i686
>    cygwin '
>     config_args='-de -Dmksymlinks -Duse64bitint -Dusethreads
>    -Uusemymalloc -Doptimize=-O3 -Dman3ext=3pm -Dusesitecustomize
>    -Dusedevel'
>     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=undef uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing
>    -pipe -Wdeclaration-after-statement',
>     optimize='-O3',
>     cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe
>    -Wdeclaration-after-statement'
>     ccversion='', gccversion='3.4.4 (cygming special, gdc 0.12, using
>    dmd 0.125)', gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
>     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=8, prototype=define
>   Linker and Libraries:
>     ld='ld2', ldflags =' -s -L/usr/local/lib'
>     libpth=/usr/local/lib /usr/lib /lib
>     libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat
>     perllibs=-ldl -lcrypt -lgdbm_compat
>     libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl.a
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s'
>     cccdlflags=' ', lddlflags=' -s -L/usr/local/lib'
> 
> Locally applied patches:
>     CYG01 - hints.cygwin.sh ldflags -s
>     CYG02 - lib-ExtUtils-Embed insensitive against leading \\s
>     CYG03 - lib-Test-Harness-Straps $ENV{PERL5LIB} = ''
>     CYG04 - major.version.cygwin.sh cygperl-5_8.dll and not cygperl-
>    5_8_x.dll
>     CYG05 - add Win32CORE to core
>     CYG07 - File-Spec-Cygwin-TMPDIR.patch
>     Bug#38628 - allow legacy Cwd->cwd()
>     Bug#40103 - File-Spec-case_tolerant.patch from 5.9.5
> 
> ---
> @INC for perl v5.8.8:
>     /usr/lib/perl5/5.8/cygwin
>     /usr/lib/perl5/5.8
>     /usr/lib/perl5/site_perl/5.8/cygwin
>     /usr/lib/perl5/site_perl/5.8
>     /usr/lib/perl5/site_perl/5.8
>     /usr/lib/perl5/vendor_perl/5.8/cygwin
>     /usr/lib/perl5/vendor_perl/5.8
>     /usr/lib/perl5/vendor_perl/5.8
>     .
> 
> ---
> Environment for perl v5.8.8:
>     CYGWIN=notitle glob:ignorecase export
>     HOME=/home/law
>     LANG (unset)
>     LANGUAGE (unset)
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>    
PATH=.:/sbin:/usr/sbin:/home/law/scripts:/home/law/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/bin:/usr/lib:/WINDOWS/system32:/WINDOWS:/WINDOWS/System32/Wbem:/Prog/XP-
>    Support Tools:/Prog/sysinternals:/Prog/Codeplay:/Prog/Common
>    Files/GTK/2.0/bin:/Prog/Microsoft Visual
>    Studio/Tools:/usr/lib/lapack:/c/Prog/Sysinternals/cmd
>     PERL_BADLANG (unset)
>     SHELL=C:/bin/bash.exe

perlop as of 5.16.0 still has the original line. I personally think the
clarification is useful (some weeks back I was surprised by 'my $x; $x
+= 1;' not producing warnings), but I don't have a commit bit.
Linda, would you mind submitting a patch for this? It'll help the odds
of this being applied, I think.


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=46581

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