develooper Front page | perl.perl5.porters | Postings from December 2002

[perl #18915] array assignment works correctly only in debugger

Thread Next
Vilem Marsik
December 6, 2002 08:45
[perl #18915] array assignment works correctly only in debugger
Message ID:
# New Ticket Created by  "Vilem Marsik" 
# Please include the string:  [perl #18915]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Message-Id: <>

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

[Please enter your report here]

A program behaves correctly, if I set in debugger a breakpoit to line 10 or 11 (or step through every line), and incorrectly, if the breakpoint is at
line 12 or later, or no breakpoint, or run without debugger.
I have this program :

#!/usr/bin/perl -w

$filename = $ARGV[0] or die "Parameter (DTD file) missing";

open FILE,$filename or die "Cannot open $filename";
while ($row=<FILE>)
        if($row =~ /<!ELEMENT\s+(\w+)\s+(\([^\)]+\)|EMPTY)/)
                my @d;
                @d = map {$_ ? ($_) : ()} ($2 eq "EMPTY" ? () : split /[|,+*+()\s]+/,$2);
                printf "%s\n",join ',',@d;

And a datafile containing single line :

<!ELEMENT benchmark (readin,database,readout)>

And so does it work - first the incorrect result, than the correct one ( should be 'readin,database,readout', and really is after the second c command

[vm@cgern dbread]$ perl bug.dtd
[vm@cgern dbread]$ perl -d bug.dtd

Loading DB routines from version 1.19
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(       $filename = $ARGV[0] or die "Parameter (DTD file) missing";
  DB<1> c 11
main::(                      @d = map {$_ ? ($_) : ()} ($2 eq "EMPTY" ? () : split /[|,+*+()\s]+/,$2);
  DB<2> c
Debugged program terminated.  Use q to quit or R to restart,
  use O inhibit_exit to avoid stopping after program termination,
  h q, h R or h O to get additional info.
  DB<2> q

[Please do not change anything below this line]
Site configuration information for perl v5.8.0:

Configured by bhcompile at Sun Sep  1 23:55:07 EDT 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
    osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi
    uname='linux 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 2002 i686 i686 i386 gnulinux '
    config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc.
-Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles
 -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005
-Uversiononly -Dpager=/usr/bin/less -isr'
    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
    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 -march=i386 -mcpu=i686',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -I/usr/include/gdbm'
    ccversion='', gccversion='3.2 20020822 (Red Hat Linux Rawhide 3.2-5)', 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 -lpthread -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
    libc=/lib/, so=so, useshrplib=true,
  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:

Environment for perl v5.8.0:
    LANGUAGE (unset)
    LOGDIR (unset)


    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About