Path: utzoo!attcan!uunet!cs.utexas.edu!asuvax!ncar!tank!gargoyle!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.lang.perl Subject: Re: perl memory usage? Message-ID: <1990Mar26.174959.20102@chinet.chi.il.us> Date: 26 Mar 90 17:49:59 GMT References: <1990Mar19.210743.15896@chinet.chi.il.us> <7480@jpl-devvax.JPL.NASA.GOV> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Chicago Public Access UNIX Lines: 26 In article <7515@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >Well, actually, it turns out to be in the pattern match itself. The reason >the assignment enabled it is that pattern matching has to do extra junk >if any of $&, $` or $' are mentioned elsewhere in the program. Perhaps a funky regexp would work better anyway, but I couldn't come up with one. I'm trying to merge items like: identifer (used for key in associative array) text (multi-line) SUMMARY: summary-text (multi-line) STATUS: text ... If I find an updated item without the SUMMARY: entry, I want to grab the summary-text from the old entry and insert it into the new above the STATUS line. My first attempt at pattern-matching with bracketed substrings failed on these multi-line strings, so I switched to the $` and $' and some tmp variables. Is there a better way? Note that I don't know which (if either) entry contains the SUMMARY: or that an old entry even exists, so the ability to test the success of the individual matches is handy. Les Mikesell les@chinet.chi.il.us