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

[perl #23016] $&, @+, @- not handled "correctly" in debugger command line

Thread Next
David Dyck
July 16, 2003 20:40
[perl #23016] $&, @+, @- not handled "correctly" in debugger command line
Message ID:
# New Ticket Created by  David Dyck 
# Please include the string:  [perl #23016]
# in the subject line of all future correspondence about this issue. 
# <URL: >

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

[Please enter your report here]

Given the interactive debugger invoked by

 $ perl -d -e 42
   > $_=qw(abc);s/b//;print $&
will print "b" as expected but
if the x command doesn't display it, e.g.
   > x $&
0  undef

but if the same code is part of the evaluated program
as in

 $ perl -lde '$_=qw(abc);s/b//;print $& ; 42'

main::(-e:1):   $_=qw(abc);s/b//;print $& ; 42
  DB<1> n
main::(-e:1):   $_=qw(abc);s/b//;print $& ; 42
  DB<1> n
main::(-e:1):   $_=qw(abc);s/b//;print $& ; 42
  DB<1> n
main::(-e:1):   $_=qw(abc);s/b//;print $& ; 42
  DB<1> x $&
0  'b'

then $& can be examined from the debugger command line.

If I modify $& from the debugger command line like
  DB<2> $_=qw(def);s/e//; print $&

so now $& eq "e", when I try to display $& I still get

  DB<3> x $&
0  'b'

even tho $_ is set to 'df'

  DB<4> x $_
0  'df'

It is confusing to say the least to see some variables
being restored from the command line evaluation, and other

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

Configured by dcd at Fri Jul 11 16:39:38 PDT 2003.

Summary of my perl5 (revision 5.0 version 9 subversion 0 patch 20156) configuration:
    osname=linux, osvers=2.4.22-pre5, archname=i686-linux
    uname='linux dd 2.4.22-pre5 #1 fri jul 11 15:45:10 pdt 2003 i686 '
    config_args='-Dmksymlinks -Dinstallusrbinperl -Uversiononly -Dusedevel -Doptimize=-O3 -g -de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 -g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs- 19990314/Linux (egcs-1.1.2 release)', 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=4
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldbm -ldb -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.9.0:

Environment for perl v5.9.0:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (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