HELP version 1.73

Hi

Urgent… I just installed ruby 1.73, some strange thing happened pls
read the following warning message:

./test.rb:90: warning: string pattern instead of regexp; metacharacters
no longer effective

While test.rb:90 is:

ha=line.split("\s*:\s*")

Is there some fundamental change taking place? Do I need to revert to
version 1.67? I have no problem there…

Shannon

Hi –

···

On Mon, 2 Dec 2002, Shannon Fang wrote:

Hi

Urgent… I just installed ruby 1.73, some strange thing happened pls
read the following warning message:

./test.rb:90: warning: string pattern instead of regexp; metacharacters
no longer effective

While test.rb:90 is:

ha=line.split(“\s*:\s*”)

Is there some fundamental change taking place? Do I need to revert to
version 1.67? I have no problem there…

Well, judging from the warning message, I’d say that in 1.7.3,
metacharacters are no longer effective in string arguments to
String#split :slight_smile:

Use a regular expression instead:

ha = line.split(/\s*:\s*/)

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

./test.rb:90: warning: string pattern instead of regexp; metacharacters
no longer effective

Give it a regexp, it want a regexp

ha=line.split("\s*:\s*")

   ha=line.split(/\s*:\s*/)

Is there some fundamental change taking place?

Now if you want to know the difference

pigeon% ruby -ve 'line = "aa\t:\tbb"; ha = line.split("\s*:\s*"); p ha'
ruby 1.7.3 (2002-11-17) [i686-linux]
-e:1: warning: string pattern instead of regexp; metacharacters no longer effective
["aa\t:\tbb"]
pigeon%

pigeon% /usr/bin/ruby -ve 'line = "aa\t:\tbb"; ha = line.split("\s*:\s*"); p ha'
ruby 1.6.8 (2002-11-09) [i686-linux]
["aa\t", "\tbb"]
pigeon%

which probably don't do what you want.

Guy Decoux

Hi,

Tks. Solved. I guess the problem happened when I tried to run http-mail
is also related to the syntax change… I don’t know why 173 changes
quite a lot…

I hope that httpmail is stil under development, alternatively, some
document of how hotmail is using the webdav system…?

Manythanks
Shannon

···

On Mon, 2 Dec 2002 01:11:26 +0900 dblack@candle.superlink.net wrote:

Well, judging from the warning message, I’d say that in 1.7.3,
metacharacters are no longer effective in string arguments to
String#split :slight_smile:

Use a regular expression instead:

ha = line.split(/\s*:\s*/)

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav