Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: "Out of memory!"? Message-ID: <8754@jpl-devvax.JPL.NASA.GOV> Date: 16 Jul 90 21:58:49 GMT References: <482@sunny.ucdavis.edu> <484@sunny.ucdavis.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 27 In article <484@sunny.ucdavis.edu> poage@sunny.ucdavis.edu (Tom Poage) writes: : So why is expanded to a list in the inner grep of : : if (@errs = grep(s/^/\t/, grep(!/^SQL:/, ))) {... : : where : if (@errs = grep( do{/^SQL:/ ? undef : s/^/\t/o;}, )) {... : : is not? The manual currently says, under grep: Note that, since $_ is a reference into the array value, it can be used to modify the elements of the array. While this is useful and supported, it can cause bizarre results if the LIST contains literal values. That last bit should probably say ...cause bizarre results if the LIST is not a named array. What you are doing, I believe, is modifying temporary stack values that are being freed when the grep exits. Don't do that. It's erroneous, in language-lawyerese. Larry