require IO::Socket::INET; my $SocketFactory= "IO::Socket::INET"; # ... my $socket= $SocketFactory->new( ... );