Today around 5:50pm, Tom Christiansen hammered out this masterpiece:

: I've thought about it, and I believe that if were are going to require
: that the function be named every time, that is, via:
: 
:     m/..../
: 
: that you should then just dispense with the slashes and make it a 
: proper function call:
: 
:     m(....)

I agree, IF this is what's to happen.

: But then you'll find that "m" is a lame name for a function, having
: but one letter as it does.  "match" or "pattern_match" or "re_match"
: or somesuch would be better.
: 
: You could "kinda" make it look like a "real" function, as has occasionally
: been suggested:
: 
:     match(STRING, PATTERN, FLAGS)

Since, in this light, barewords are evil, this might be forced to look like:

  match( STRING, qr( PATTERN ), FLAGS )

: But before that gets too much support, that has several problems.
: First, unless you have rather clever new context coercion prototypes
: of type regex (which would let us define split(), too, though), you
: won't properly pass things like "\b" and friends through when you
: should.  A regex only kinda acts like a doubly quoted string; it
: isn't, really, in terms of backslash escapes.

See above suggestion.

: Second, positional parameters are not conducive to omissions beyond tail-end
: ones. Thus, you couldn't easily have all of
: 
:     1 match(STRING, PATTERN, FLAGS)
:     2 match(STRING, PATTERN)
:     3 match(PATTERN, FLAGS)
:     4 match(PATTERN)
: 
: because you can't really tell 2 from 3.

If qr() were required for PATTERN, would this become less of an issue?  Or no
issue?

-- 
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce <belg4mit at MIT dot EDU>

Reply via email to