in reply to using Net::Telnet to test Apache
Try using a simple IO::Socket to set up a TCP connection to your web server. You can then freely read and write to it as you need to.
An alternative (as another poster mentioned) is to use the LWP modules, which offer a complete HTTP client library.my $s = new IO::Socket::INET ("www.example.com:80") or die "Couldn't connect: $!"; print $s "GET / HTTP/1.0\n\n"; if (<$s> =~ /HTTP\S+ ([345].*)/) { die "Error: $1"; } ...
use LWP::Simple; # or you could do more advanced stuff my $results = get("http://www.example.com/"); if (!defined($results)) { die "Error!"; } ...
|
|---|