Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Need help with (\d+) problem (s/...(\d+)/$1/ not working?) Message-ID: <10258@jpl-devvax.JPL.NASA.GOV> Date: 6 Nov 90 18:15:17 GMT References: <1990Nov6.153943.14710@uvaarpa.Virginia.EDU> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 17 In article <1990Nov6.153943.14710@uvaarpa.Virginia.EDU> worley@compass.uucp writes: : : From: gustav@tharr.UUCP (Paul Moore) : : > ($a = $string) =~ s/\w+\s+(\d+)/$1/; : : If you really do want $a to equal "95", you could just say $a = $1 at : the end ($1 keeps its value outside the replacement pattern). I'm sure : there are better ways, as well. (but I'm too tired to think of one just : now...) : : ($a) = $string =~ s/\w+\s+(\d+)/$1/; Well, no, actually. I've never made s/// do anything special in array context. Terminal laziness, I guess. Larry