From: Mark W. <mew...@un...> - 2000-05-25 00:36:10
|
I rewrote my patch using the second option you presented. I'll see if I come up with something better when I play with the schema module for my DSML stuff. Mark Graham Barr wrote: > On Tue, May 23, 2000 at 07:19:38PM -0500, Mark Wilcox wrote: > > > > > I think that block would be better written as > > while($value =~ s/^[\s,]*(["']?[^"'\s()]+["']?[,\s]*)//) { > $word .= $1 > @quotes = $word =~ /(["'])/g; # broken emacs '"])/; > last unless @quotes & 1; # Until even num of quotes > } > > However, we can do better. > > @quotes = $word =~ /(["'])/g; > last unless @quotes & 1; > > could just be > > last unless $word =~ tr/"'// & 1; > > But I think it could also be done with > > $value =~ s/^[\s,]*((["']?)(\\.|[^"'()\\]+)*\2)// or die "..."; > > However back to the initial problem, the die ... > > I think the die is probably the correct thing, but it should be caught > by an eval {} in new() and have new() return an error. > > Having said that, currently ::Schema just warns and returns undef. It probably > should do better than that. So I am open to suggestions. That goes for > all other modules too. > > Graham. |