Path: utzoo!attcan!uunet!mcsun!ukc!axion!tharr!gustav From: gustav@tharr.UUCP (Paul Moore) Newsgroups: comp.lang.perl Subject: Multi-line strings and $* Message-ID: <1391@tharr.UUCP> Date: 5 Nov 90 23:19:35 GMT Reply-To: gustav@tharr.UUCP (Paul Moore) Organization: Public access to Usenet in the UK Lines: 26 I'm having a bit of trouble understanding how to use $* to handle multiline strings. I have a string, $article, which contains a large number of lines of text (OK, so it's a news article...) The article may end with any number of blank lines (ie, \n\n\n), which I want to remove. My first thought is $article =~ s/\n+$//, with $* = 0. But the manual says "Pattern matches on strings containing multiple newlines can produce confusing results when $* is 0". Um. However, if $* = 1, there seems to be no way of anchoring a pattern to the end (or the beginning) of a string. At this point, I started getting frustrated... Any clues, anybody? Thanks in advance, Gustav. -- /----------------------------------------------------------------\ | Paul Moore E-Mail: ...!ukc!tharr!gustav | | 10, Mulberry Rise or ...!ukc!cix!pmoore | | Northwich, Cheshire or (BEST) pmoore@cix.compulink.co.uk | <-- tharr *free* public access to Usenet in the UK 0234 261804 -->