From: kasal@... (Stepan Kasal) Date: 2002-07-12T17:52:09+09:00 Subject: Re: String#split converts string args to regexes -- ? Hallo, On Thu, 11 Jul 2002 15:31:56 GMT, Matz wrote: > You will be warned if you specify a string that contains regexp > metacharacters. So you will not see silent behavior change without > notices. sorry, Matz, for bothering you again :-( At first, this seems right. But imagine: When I experience such a warning, I usually search for a way to avoid it. Thus I resort to Regexp.new(Regexp.quote(s)) because I want to get rid of the warning. The only situations in which one can safely use split(string,..) are those in which they are sure that the string may not contain metacharacters. But this almost always means that the string is entered literally in the program. And in these situations one can usually write /blah/ instead of "blah". So I think that that warning may be actually discouradging using the split(string, ..) form. For these reasons, I'd suggest that the warning is issued only in $VERBOSE or $DEBUG mode; ie. -w or -d. (I'm not sure which one, but it's probably clear to most people here. It would be "awk --lint" in GNU awk.) And, of course, I like the idea of ``require "compat1.6"'', as presented in ruby-talk:43938 and pushed by Tom Sawyer several times. Stepan