Path: utzoo!attcan!uunet!samsung!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: I would prefer ~= instead of =~ Message-ID: <7431@jpl-devvax.JPL.NASA.GOV> Date: 15 Mar 90 18:08:18 GMT References: <1275@ttds.UUCP> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 22 In article <1275@ttds.UUCP> juha@tds.kth.se (Juha Sarlin) writes: : I think it would be nice if the =~ operator was renamed to ~=. This : would make it more consistent with the other assignment operators and : less ambiguous; eg, "$a =~0" is currently not the same as "$a = ~0". But =~ isn't an assignment operator, exactly, even though sometimes it requires an lvalue. : Unfortunately this change would probably break most current perl scripts, : but perhaps ~= could just be added as an alias for =~ and !~= as an alias : for !~. Then we'd only have to wait a few hundred years for everybody to : stop using the obsoleted operators. :-) I picked =~ and !~ because that's what csh uses. (I would've used ~ like awk but ~ means something else entirely in C.) I think that the situation $a =~0 arises much less frequently than the normal use of =~, and for the former C shell programmers in the crowd, it would only cause more confusion to switch. Besides, $a = ~0 is much more readable, so I haven't much sympathy. I won't say what I think of 3 character operators--you wouldn't like me any more... Larry