Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s/foo//e evaluating empty replacement string #6682

Closed
p5pRT opened this issue Aug 5, 2003 · 4 comments
Closed

s/foo//e evaluating empty replacement string #6682

p5pRT opened this issue Aug 5, 2003 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 5, 2003

Migrated from rt.perl.org#23227 (status was 'resolved')

Searchable as RT23227$

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2003

From DanVDascalescu@yahoo.com

Created by DanVDascalescu@yahoo.com

#! perl -w
# This program should display nothing

$replacement='';
$_='foo'; s/foo/$replacement/e;
print; # OK, $_ becomes ''

$_='foo'; s/foo//e; # BUG​: $_ remains 'foo'
print;

My apologies if this has already been reported.

Hope this helps,
Dan Dascalescu

--
Top 5% C, Perl and XML programmer certified by Brainbench,
looking for Australian job offers. Check out my CV at
http​://dan.notlong.com

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl v5.8.0:

Configured by daves at Fri Nov  8 00:53:50 2002.

Summary of my perl5 (revision 5 version 8 subversion 0) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef 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='cl', ccflags ='-nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
    optimize='-MD -DNDEBUG -O1',
    cppflags='-DWIN32'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release  -libpath:"D:\p4\Apps\Gecko\MSI\data\ActivePerl\Perl\lib\CORE"  -machine:x86'
    libpth=C:\PROGRA~1\MICROS~3\VC98\lib
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
    gnulibc_version='undef'
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release  -libpath:"D:\p4\Apps\Gecko\MSI\data\ActivePerl\Perl\lib\CORE"  -machine:x86'

Locally applied patches:



@INC for perl v5.8.0:
    .


Environment for perl v5.8.0:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\DN;D:\DJGPP\BIN;D:\PRG\ASM;D:\PRG\BP;D:\PRG\BC\BIN;C:\C\VC7\BIN
    PERL_BADLANG (unset)
    SHELL (unset)

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2003

@rgs - Status changed from 'new' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2003

From @andk

On 5 Aug 2003 22​:26​:31 -0000, Dan Dascalescu (via RT) <perlbug-followup@​perl.org> said​:

  > #! perl -w
  > # This program should display nothing

  > $replacement='';
  > $_='foo'; s/foo/$replacement/e;
  > print; # OK, $_ becomes ''

  > $_='foo'; s/foo//e; # BUG​: $_ remains 'foo'
  > print;

  > My apologies if this has already been reported.

Even better, it has been fixed (in patch 18118). The fix will also be
in 5.8.1.

But thanks for the testcase anyway, it's highly appreciated!
--
andreas

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2003

@rgs - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant