in reply to socket programming
Net::Telnet is used to establish a telnet connection and interacting with the resulting interactive terminal.
Net::SSH::Expect is the parallel for ssh.
If that's what you want to do, it makes perfect sense to use one of these. But you didn't mention telnet (or ssh). You simply mentioned establishing a socket connection. These are not appropriate for that.
For that, you could use the C-style builtin socket functions directly. But I recommend using IO::Socket::INET or IO::Socket::IP instead. They are thin wrappers for the same C functions, but they are easier to use because they aren't limited to what works well in C. Code that uses them is therefore easier to read/maintain/debug/etc than code that uses a C-style interface.
Specifically, I recommend using IO::Socket::IP because it supports IPv4 and IPv6, whereas IO::Socket::INET only supports IPv4.
|
|---|