> On Thu, Aug 17, 2000 at 01:07:30PM -0400, Stephen P. Potter wrote:
> > * Replace C<m//>, C<tr///>, and C<s///> with equivalent regularized
> >   functions that take mulitple arguments instead of using specialized
> >   syntax.  It would be best if the names could be more "complete", like
> >   match(), translate(), and substitute() (although translate and substitute
> >   are rather long).

I was thinking of this too. Well, not quite -- I certainly don't want m,
tr, or s to go away (or /regex/ either.) But the =~ bothers me. How
about disallowing m{...} and using m{expr}/.../?

foreach $line (@foo) {
        m{$line}/pattern/;
}

That seems better than $line =~ ... but not by much. How about
disallowing m(...) and using

m($line, /pattern/) ? (similar to split)

Hm. Tough to parse. Where do you look for the opening delimiter? More
similar to split:

m(/pattern/, $line)

I like that one. As long as split,m,tr,s can all handle non-/ delimiters
(as split currently cannot). And as long as I can still say

while(<>) { print "found it!" if /needle/ }

when I don't need to specify the variable.

Reply via email to