develooper Front page | perl.perl5.porters | Postings from July 2008

[perl #56880] can't use v[0-9]+ as label (vstring)

From:
perlbug-followup
Date:
July 13, 2008 12:30
Subject:
[perl #56880] can't use v[0-9]+ as label (vstring)
Message ID:
rt-3.6.HEAD-8814-1215911244-306.56880-75-0@perl.org
# New Ticket Created by  l.mai@web.de 
# Please include the string:  [perl #56880]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=56880 >



This is a bug report for perl from l.mai@web.de,
generated with the help of perlbug 1.35 running under perl v5.10.0.


-----------------------------------------------------------------
[Please enter your report here]

% perl -e 'v0: ;' 
syntax error at -e line 1, near "v0:"
Execution of -e aborted due to compilation errors.
% perl -e 'v0x: ;'
%

v-string parsing gets in the way of statement labels. Adding any
non-digit character makes it parse as a bareword/label. I think this is
a bug because (with the exception of quoting operators) perl lets you
use any keywords as labels. This issue is similar to the (v123 => 45)
thing fixed in 5.8.1 (5.8.0 parsed it as chr(123) instead of 'v123').
It seems inconsistent to treat labels differently.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
This perlbug was built using Perl v5.8.8 - Wed Mar 22 20:53:12 CET 2006
It is being executed now by  Perl v5.10.0 - Wed Dec 19 19:01:35 CET 2007.

Site configuration information for perl v5.10.0:

Configured by mauke at Wed Dec 19 19:01:35 CET 2007.

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.6.22-gentoo-r9, archname=i686-linux
    uname='linux nora 2.6.22-gentoo-r9 #3 preempt sat nov 3 22:12:09 cet 2007 i686 amd athlon(tm) 64 processor 3200+ authenticamd gnulinux '
    config_args=''
    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='gcc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2 -march=native -fomit-frame-pointer',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='4.2.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.6.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -march=native -fomit-frame-pointer -L/usr/local/lib'

Locally applied patches:
    SAFEARGV0 - disable magic open in <ARGV>
    METHQUAL0 - allow qualified method calls without a valid object
    UNWARN0 - disable stupid warnings for print and qw

---
@INC for perl v5.10.0:
    /home/mauke/usr/local/lib/perl5/5.10.0/i686-linux
    /home/mauke/usr/local/lib/perl5/5.10.0
    /home/mauke/usr/local/lib/perl5/site_perl/5.10.0/i686-linux
    /home/mauke/usr/local/lib/perl5/site_perl/5.10.0
    .

---
Environment for perl v5.10.0:
    HOME=/home/mauke
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LC_COLLATE=POSIX
    LD_LIBRARY_PATH=/home/mauke/usr/local/lib
    LOGDIR (unset)
    PATH=/home/mauke/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.2:/opt/sun-jdk-1.4.2.13/bin:/opt/sun-jdk-1.4.2.13/jre/bin:/opt/sun-jdk-1.4.2.13/jre/javaws:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin
    PERL_BADLANG (unset)
    PERL_UNICODE=SAL
    SHELL=/bin/zsh




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About