On Thu, Oct 24, 2002 at 09:59:00AM -0700, Michael Lazzaro wrote:
> Noone ever guesses that =~ means "matching"

That's because it doesn't.  =~ means something more akin to "apply"
but it's only valid for the three m//, s///, tr/// ops.  That'll
change in perl 6 though  :-)

> If anything, I'd almost suggest the other way around, such that ~ means 
> matching and ~= means matching assignment:
> 
>    $str1 ~ $str2                # $str1 =~ m/$str2/
>    $str ~ /foo/                 # $str1 =~ m/foo/
>    $str2 = ($str ~ /foo/bar/);  # perform subst, assign result to $str2
>    $str ~= /foo/bar/;           # perform subst, assign result to $str

I like it even though the naked ~ always makes me think of awk.

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to