Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!mmdf From: marc@athena.mit.edu (Marc Horowitz) Newsgroups: comp.lang.perl Subject: s///e bizarreness Message-ID: <1991Jan3.043016.27394@uvaarpa.Virginia.EDU> Date: 3 Jan 91 04:30:16 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: marc@mit.edu Organization: The Internet Lines: 24 I noticed this strange behavior yesterday: % perl -e '$_="|2+2|";s/\|([^\|]*)\|/$1/;print "$_\n";' 2+2 % perl -e '$_="|2+2|";s/\|([^\|]*)\|/$1/e;print "$_\n";' 2+2 % perl -e '$_="|2+2|";s/\|([^\|]*)\|/$1/ee;print "$_\n";' 4 % perl -v This is perl, version 3.0 $Header: perly.c,v 3.0.1.9 90/11/10 01:53:26 lwall Locked $ Patch level: 41 The first one makes sense. The last two are what's confusing me. Is this a bug, or an undocumented feature (or both? :-) I tested this on a vax running bsd 4.3, perl compiled with gcc 1.37 and a decmips running Ultrix 3.1, perl compiled with "gcc version 1.37.1 OSF 1.9.2.13 Ultrix Dec Mips Dec 14 1990." Shouldn't the second program print "4" and the third be an error? Marc