Re: New match and subst replacements for =~ and !~ (was Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.)

2000-08-29 Thread Bart Lateur
On Mon, 28 Aug 2000 20:26:41 -0700, Nathan Wiger wrote: foreach (@str) { print "Got it" if match /\w+/, @str; if (/\w+/) { $gotit = 1 }; } print "Got it" if $gotit; Now if DWIM just worked for email as well... ;-) You mean, like grep? print "Got it" if

Re: New match and subst replacements for =~ and !~ (was Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.)

2000-08-28 Thread Randy J. Ray
Just to extend this idea, at least for the exercise of it, consider: match; # all defaults (pattern is /\w+/?) match /pat/;# match $_ match /pat/, $str; # match $str match /pat/, @strs; # match any of @strs subst; # like s///, pretty

Re: New match and subst replacements for =~ and !~ (was Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.)

2000-08-28 Thread Nathan Wiger
"Randy J. Ray" wrote: # These are pretty cool... foreach (@old) { @new = subst /hello/X/gi, @old; s/hello/X/gi; push @new, $_; } This implies that the subst keyword would *both* modify LIST in-place and return a complete copy of the list as a

New match and subst replacements for =~ and !~ (was Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.)

2000-08-25 Thread Nathan Wiger
[cc'ed to -regex b/c this is related to RFC 138] Proposed replacements for m// and s///: match /pattern/flags, $string subst /pattern/newpattern/flags, $string The more I look at that, the more I like it. Very consistent with split and join. You can now potentially match on

New match and subst replacements for =~ and !~ (was Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.)

2000-08-25 Thread Nathan Wiger
[cc'ed to -regex b/c this is related to RFC 138] Proposed replacements for m// and s///: match /pattern/flags, $string subst /pattern/newpattern/flags, $string The more I look at that, the more I like it. Very consistent with split and join. You can now potentially match on