On Fri, May 22, 2009 at 11:22:25AM -0400, Uri Guttman wrote:
> >>>>> "SB" == Samuel Baldwin <[email protected]> writes:
> 
>   SB> A bit of a side question; when would you ever want to try and match an
>   SB> empty regex? Wouldn't it be semantically saner to use defined?
> 
> i did mention a common use in split( //, ... ). that explodes a string
> into an array of all the chars which is useful sometimes. and that is
> always an null regex afaik. it has the same effect as m/(.)/s in a list
> context.
> 
> and defined has nothing to do with m//. m// matches a null string or
> anywhere between chars. it would work on an undefined value but trigger
> the usual warning.

A sane use would be as a parameter to a function that takes a
filter pattern, in a case where you don't want to filter anything
out.  Since // always matches, it turns the match into a no-op.

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to