[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Bad subroutine!



On Thu, May 27, 1999 at 04:38:04PM -0600, A K Suska wrote:
>  $string =~ s/ $//;
>  $string =~ s/^ //;
>  return $string
> 
> If your string contains newlines, you may consider using the /s modifier to the
> substitution to force absolute beginning and end--but always TIMTOWTDI.
> 

Ah, you've got that backwards...  ^ and $ match at the absolute beginning
and end by default.  /m, for multiple lines, allows then to match before
and after newlines, as appropriate.  /s, for single line, allows . to match
newlines, which it does not by default.

Other than by involvement of the deprecated $*, /s has no effect on ^ and
$, and /m has no effect on ..

Ronald

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org