Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!mips!prls!pyramid!unify!csusac!ucdavis!sunny!poage From: poage@sunny.ucdavis.edu (Tom Poage) Newsgroups: comp.lang.perl Subject: Re: "Out of memory!"? Message-ID: <484@sunny.ucdavis.edu> Date: 14 Jul 90 06:31:27 GMT References: <482@sunny.ucdavis.edu> Reply-To: poage@sunny.ucdavis.edu (Tom Poage) Organization: UCDMC Clinical Engineering, Sacto., CA Lines: 37 In article <482@sunny.ucdavis.edu> poage@sunny.ucdavis.edu (I) write: ... This gives "Out of memory!" >if (@errs = grep( do{/^SQL:/ ? undef : s/^/\t/o;}, )) {... This works > if (@errs = grep(s/^/\t/, grep(!/^SQL:/, ))) {... So does this > @messages = ; > if (@errs = grep( do{/^SQL:/ ? undef : s/^/\t/o;}, @messages)) {... Doing some additional poking around, open(JUNK, "junkfile"); @x=grep(do{!/^SQL:/?s/^/\t/:undef;},); dumps core. Somehow the isn't expanded to a list: at the lowest level, perl expects a struct string *, but actually gets a stuct _iobuf * as the second argument to grep. 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? -- Tom Poage, Clinical Engineering Universiy of California, Davis, Medical Center, Sacramento, CA poage@sunny.ucdavis.edu {...,ucbvax,uunet}!ucdavis!sunny!poage