Damian Conway wrote:
 
>I'm well-known as a non-delving-into-the-guts type of guy. I don't have 
 

 

 
I totally aggree with you that delving into the guts is the last thing we, 
the people that use perl as a tool, want to do! The fact is that, the least 
we know about the internals, the better it is. But for this to be possible, 
we need modules that provide the functionality we need without making us 
deal with the rawness of perl guts. And that's why I defend the exposing of 
the regexp subsystem interface (as all other subsystems), so that one can 
write (and we can use!!!) modules that can match regexps against file 
streams, we can have partial matches, approximate, etc... Having the guts 
interface opens up the door for everything that is doable with a regexp 
engine.
 

 
As to the efficiency problem, I said it before and I'm saying it again: my 
opinion is to put both approaches (overloaded =~ in object module and having 
=~ work for a sub). One of them is very flexible, and possibly can do things 
the other can not, and the other is very efficient for the general case, the 
one that will be used 90% of the time.
 

 
As Rick pointed out, there's no problem with overloading =~ for an object, 
in the same way it's done with `eq', and one object's function could return 
either an object or a closure (a sub reference), so that a module could even 
hide the details of whether it's using the object interface with the 
overloaded =~ or the new behaviour of =~ with a sub lvalue.
 

 

 
Branden.
 

_________________________________________________________
Oi! Você quer um iG-mail gratuito?
Então clique aqui: http://www.ig.com.br/paginas/assineigmail.html

Reply via email to