chris01
chris01

Reputation: 12329

Perl CPAN: module for network-connectivity

I need to check the network-availability of some webservers (HTTP/HTTPS). For that I just need ip/dns and port. But I have a list of URLs. And I would like to use a CPAN-module for that job.

But: - HTTP::Tiny, LWP::UserAgent, ... checks the HTTP-stats, not the network-status. I need to check the 2nd (connection established) and I dont care about the HTTP-header and content.

So any ideas if a HTTP-module also provides a network-status??

Thanks!

Upvotes: 0

Views: 117

Answers (1)

ikegami
ikegami

Reputation: 385917

You can parse URLs to obtain the host and port using URI module.

Creating a connection can be done using the functions provided by Socket, or using the higher-level class IO::Socket::IP.

Upvotes: 5

Related Questions