Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!haven!uvaarpa!mmdf From: worley@compass.uucp (Dale Worley) Newsgroups: comp.lang.perl Subject: Need help with (\d+) problem (s/...(\d+)/$1/ not working?) Message-ID: <1990Nov6.153943.14710@uvaarpa.Virginia.EDU> Date: 6 Nov 90 15:39:43 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.uucp Organization: The Internet Lines: 16 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/; Dale Worley Compass, Inc. worley@compass.com -- Bring your mistress! Bring your boyfriend! Bring your wife! -- La Cage aux Folles