develooper Front page | perl.perl5.porters | Postings from October 2003

[perl #24280] warning from undefined value in comment

Thread Next
From:
perlbug-followup
Date:
October 25, 2003 12:18
Subject:
[perl #24280] warning from undefined value in comment
Message ID:
rt-24280-66432.10.1101820919174@rt.perl.org
# New Ticket Created by  coyote.frank@gmx.net 
# Please include the string:  [perl #24280]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24280 >



This is a bug report for perl from coyote.frank@gmx.net,
generated with the help of perlbug 1.34 running under perl v5.8.0.


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

m/(?x).../ seems to interpret variables in comments, leading
to unexcpected warnings, while  m/.../x does not.
Example:


 | use warnings;
 | my $line = 'bla';
 | $line =~m!(?x)
 |     (.*) # $1 is not yet defined, so I get a warning
 |     !; # regex end
 | $line =~m!
 |     (.*) # $2 is not yet defined but I don't get a warning
 |     !x; # regex end

with use strict and other variable names one could even
make the syntax check fail:

 | use strict;
 | my $line = 'foo';
 | $line =~m!(?x)(.*) # $bar is not defined
 |     !; # regex end

 | prompt$ perl x.pl
 | Global symbol "$bar" requires explicit package name at x.pl line 3.
 | Execution of x.pl aborted due to compilation errors.


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.8.0:

Configured by pixel at Thu Mar  6 22:12:16 CET 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.20-2mdkenterprise, archname=i386-linux-thread-multi
    uname='linux no.mandrakesoft.com 2.4.20-2mdkenterprise #1 smp mon dec 9 14:28:32 cet 2002 i686 unknown unknown gnulinux '
    config_args='-des -Darchname=i386-linux -Dcc=gcc -Doptimize=-O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dman3ext=3pm -Dcf_by=MandrakeSoft -Dmyhostname=localhost -Dperladmin=root@localhost -Dd_dosuid -Ud_csh -Duseshrplib -Dusethreads'
    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=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -I/usr/include/gdbm'
    ccversion='', gccversion='3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)', 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 -lndbm -lgdbm -ldl -lm -lpthread -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
    libc=/lib/libc-2.3.1.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.3.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.0:
    /usr/lib/perl5/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/5.8.0
    /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.0
    /usr/lib/perl5/vendor_perl
    .

---
Environment for perl v5.8.0:
    HOME=/home/steffen
    LANG=en_US
    LANGUAGE=en_US:en
    LC_ADDRESS=en_US
    LC_COLLATE=en_US
    LC_CTYPE=en_US
    LC_IDENTIFICATION=en_US
    LC_MEASUREMENT=en_US
    LC_MESSAGES=en_US
    LC_MONETARY=en_US
    LC_NAME=en_US
    LC_NUMERIC=en_US
    LC_PAPER=en_US
    LC_TELEPHONE=en_US
    LC_TIME=en_US
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/steffen/p/bin:/home/steffen/bin:.:/home/stef/bin:/usr//bin:/bin:/usr/bin::/usr/local/bin:/usr/X11R6/bin:/usr/games:/usr/X11R6/bin:/home/stef/bin:/home/steffen/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash


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