From: Yves Orton Date: Sat, 11 Nov 2006 16:25:17 +0000 (+0100) Subject: Re: [perl #27053] /^/m doesn't match after a newline at the end of the string X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0d520e8e301fa0eda31a3f68440e7e9b426a290f;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #27053] /^/m doesn't match after a newline at the end of the string Message-ID: <9b18b3110611110725t3dc1e447v751ef5880363aa9b@mail.gmail.com> p4raw-id: //depot/perl@29257 --- diff --git a/pod/perlre.pod b/pod/perlre.pod index 45e41e5..fcf3d51 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -110,7 +110,8 @@ newline at the end), and Perl does certain optimizations with the assumption that the string contains only one line. Embedded newlines will not be matched by "^" or "$". You may, however, wish to treat a string as a multi-line buffer, such that the "^" will match after any -newline within the string, and "$" will match before any newline. At the +newline within the string (except if the newline is the last character in +the string), and "$" will match before any newline. At the cost of a little more overhead, you can do this by using the /m modifier on the pattern match operator. (Older programs did this by setting C<$*>, but this practice has been removed in perl 5.9.)