Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: mg, causes numerous core dumps Message-ID: <1991Jun22.143435.4132@convex.com> Date: 22 Jun 91 14:34:35 GMT References: Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 31 Nntp-Posting-Host: pixel.convex.com FYI, mg was posted: 29May91 Kazumasa Utashiro 18424 mg: multi-line grep<. Anyway, while I don't get coredumps running the program at 4.009 or 4.010, neither does it give me the right answer. Looking at the code, it is keying off of whether $] > 4.003 and running different code depending. The code it runs at newer patchlevels is this: eval "while(/$opt_p/og$ig){push(\@x,length(\$`),length(\$&));}"; where $opt_p is your pattern. (The /o seems unneeded for a constant pattern though, which you'll have after the qq interpolation.) Playing with the debugger, I find that it doesn't like me to examine $' in here -- it gives me a SEGV core dump if I do it. Here's a trivial little test that also causes the problem to manifest: $_ = "xxxxxxxxxx"; while (/x/g) { print $`, '|', $&, '|', $', ++$i, "\n"; } Larry? --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "So much mail, so little time."