develooper Front page | perl.perl5.porters | Postings from June 2011

[perl #93358] perlop's description of => is missing an acceptable first character

Thread Previous | Thread Next
From:
dmcbride @ cpan . org
Date:
June 22, 2011 15:58
Subject:
[perl #93358] perlop's description of => is missing an acceptable first character
Message ID:
rt-3.6.HEAD-16080-1308783520-1254.93358-75-0@perl.org
# New Ticket Created by  dmcbride@cpan.org 
# Please include the string:  [perl #93358]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=93358 >



This is a bug report for perl from dmcbride@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.12.3.


-----------------------------------------------------------------
[Please describe your issue here]

The perl docs say:

       The "=>" operator is a synonym for the comma except that it causes its
       left operand to be interpreted as a string if it begins with a letter
       or underscore and is composed only of letters, digits and underscores.

This tells me that "-" is not allowed as a first character of the "key"
to the fat-comma operator.  Yet the CGI perldoc gives it as an example in
its synopsis:

    $cookie1 = $q->cookie(-name=>'riddle_name', -value=>"The Sphynx's Question");

So which is correct?  Trying it out says that CGI is correct, based on
implementation:

$ perl -MData::Dumper -le '%x=(-f=>1,-foo=>2,-g-b=>3);print Dumper \%x'
$VAR1 = {
          '' => 3,
          '-foo' => 2,
          '-f' => 1
        };

Though that -g-b one is interesting, and may be a separate bug in
some manner (I don't know what it really should do, but I doubt it
should become C<''>).

Other "left operands" such as -gx-b and g-b both create compilation
errors, as I would expect.

I would suggest an update to the perlop doc at the very least, to say
that - is a valid first character.  I don't think that this can be changed
now implementation-wise.  I'm not sure what should be done with -g-b though.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=docs
    severity=low
---
Site configuration information for perl 5.12.3:

Configured by Gentoo at Wed Apr 27 05:16:03 MDT 2011.

Summary of my perl5 (revision 5 version 12 subversion 3) configuration:
   
  Platform:
    osname=linux, osvers=2.6.37-gentoo-r4, archname=x86_64-linux-thread-multi
    uname='linux naboo 2.6.37-gentoo-r4 #1 smp tue apr 12 07:12:43 mdt 2011 x86_64 intel(r) core(tm) i7 cpu 930 @ 2.80ghz genuineintel gnulinux '
    config_args='-des -Duseshrplib -Darchname=x86_64-linux-thread -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-O3 -pipe -march=core2 -Dldflags=-Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib64/perl5/5.12.3 -Darchlib=/usr/lib64/perl5/5.12.3/x86_64-linux-thread-multi -Dsitelib=/usr/lib64/perl5/site_perl/5.12.3 -Dsitearch=/usr/lib64/perl5/site_perl/5.12.3/x86_64-linux-thread-multi -Dvendorlib=/usr/lib64/perl5/vendor_perl/5.12.3 -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.12.3/x86_64-linux-thread-multi -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/share/man/man1 -Dsiteman3dir=/usr/share/man/man3 -Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.12.3 -Dlocincpth=  -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Dinstallusrbinperl=n -Ud_csh -Uusenm -Di_ndbm -Di_gdbm 
 -Di_db -Dusethreads -DDEBUGGING=none -Dinc_version_list=5.12.2/x86_64-linux-thread-multi 5.12.2 5.12.1/x86_64-linux-thread-multi 5.12.1 5.12.0/x86_64-linux-thread-multi 5.12.0  -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64'
    hint=recommended, useposix=true, d_sigaction=define
    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='x86_64-pc-linux-gnu-gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 -pipe -march=core2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe'
    ccversion='', gccversion='4.4.5', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
    libpth=/usr/local/lib64 /lib64 /usr/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.11.3.so, so=so, useshrplib=true, libperl=libperl.so.5.12.3
    gnulibc_version='2.11.3'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O3 -pipe -march=core2 -Wl,-O1 -Wl,--as-needed'

Locally applied patches:
    0001-gentoo_MakeMaker-RUNPATH.diff
    0002-gentoo_config_over.diff
    0003-gentoo_cpan_definstalldirs.diff
    0004-gentoo_cpanplus_definstalldirs.diff
    0005-gentoo_create-libperl-soname.diff
    0006-gentoo_MakeMaker-delete_packlist.diff
    0007-fixes_8d66b3f9_h2hp_fix.diff
    0008-fixes_f178b03b_h2ph_using_deprecated_goto.diff
    0009-gentoo_mod-paths.diff
    0010-gentoo_enc2xs.diff
    0011-gentoo_IO-Compress_AutoLoader_dropped_from_Compress-Zlib.diff
    0012-gentoo_drop-fstack-protector.diff
    0013-fixes_539689e74a_unwarrantedly_laundering_tainted_data.diff

---
@INC for perl 5.12.3:
    /etc/perl
    /usr/lib64/perl5/site_perl/5.12.3/x86_64-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.12.3
    /usr/lib64/perl5/vendor_perl/5.12.3/x86_64-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.12.3
    /usr/lib64/perl5/site_perl/5.12.2/x86_64-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.12.2
    /usr/lib64/perl5/site_perl
    /usr/lib64/perl5/vendor_perl/5.12.2/x86_64-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.12.2
    /usr/lib64/perl5/vendor_perl
    /usr/lib64/perl5/5.12.3/x86_64-linux-thread-multi
    /usr/lib64/perl5/5.12.3
    /usr/local/lib/site_perl
    .

---
Environment for perl 5.12.3:
    HOME=/home/dmcbride
    LANG=en_US.utf8
    LANGUAGE=
    LC_ALL=en_US.utf8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/dmcbride/bin:/usr/lib/distcc/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/gcc-bin/4.4.5:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.5:/opt/cuda/bin:/share/cvs/bin:/usr/local/bin:/usr/games/bin:/share/bin:/share/darin/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash


Thread Previous | 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