tony summerfelt <snowzone5 / hotmail.com> writes:

> gah, ruby is doing it to me again:
> 
>  logline=String.new("+ 30 Jan 12:20:09 [3988] addr: x.x.x.x")
>  tda=Array[(logline.split(/\[\d+\]/))]
>  tda.first

split already returns an Array - no need to create one:

tda= logline.split(/\[\d+\]/)  
tda.first

=> "+ 30 Jan 12:20:09 "

(what you did was 'obtain the array generated by split and stuff it as the
 first element into a new array', thus getting 
 [["+ 30 Jan 12:20:09 ", "addr: x.x.x.x"]])

HTH & kind regards
frank

-- 
Frank Schmitt 
quattro research GmbH	
e-mail: schmitt NO at SPAM quattro-research !@! dot com