Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: IPv6 Supported Perl Modules

by VinsWorldcom (Priest)
on Oct 25, 2012 at 17:54 UTC ( #1000911=note: print w/ replies, xml ) Need Help??


in reply to IPv6 Supported Perl Modules

Net::Telnet does support IPv6 - although not natively. By that, I mean, you can't do a:

Net::Telnet-new(host => 'IPv6.host.com');

I've been corresponding with Jay Rogers - author of Net::Telnet - to add native IPv6 support. He gave me a brilliant workaround that is very easy and not at all kludgey as many workarounds go.

Use the 'fhopen' argument of the new() constructor to take in an IPv6 connection (from say IO::Socket::IP). This is the example that works brilliantly for me:

use IO::Socket::IP -register; use Net::Telnet; ... my $socket = IO::Socket::IP->new( PeerHost => $IPv4orv6Host, PeerPort => 23, Family => AF_INET # or AF_INET6 ) or die "not connected\n"; my $session = Net::Telnet->new( fhopen => $socket ); ...

That will continue to work legacy is $IPv4orv6Host is an IPv4 host or hostname that resolves to an IPv4 address and will also support IPv6 hosts - since IO::Socket::IP can handle the IPv4/v6 address families. The Net::Telnet 'fhopen' argument simply operates on the open $socket handle.


Comment on Re: IPv6 Supported Perl Modules
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-09-21 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (172 votes), past polls