From: Chad Fowler Date: 2004-04-25T01:45:22+09:00 Subject: Re: Playing with sockets... --Apple-Mail-1--708782408 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 23/4/2004, at 7:41 PM, Hal Fulton wrote: > I'm writing a little expect-like piece of code and trying to test it > by connecting to a telnet port. I know this isn't the solution to your actual problem, but have you seen the Telnet module? It looks very similar to what you're trying to do: (adapted from the source of the telnet module--untested) hal = Net::Telnet::new({"Host" => "hypermetrics.com", "Timeout" => 10, "Prompt" => /[$%#>] \z/n}) hal.login("bob", "foobar") hal.waitfor({"Match" => /Login incorrect/}) puts "Fin" --Apple-Mail-1--708782408--