Hi all!
I got a little problem getting HTTP::Size to work:
#!/usr/bin/perl
use HTTP::Size;
my $url = "http://www.trempi.com";
my $size = HTTP::Size::get_size( $url );
print "Content-type: text/html\n";
if( defined $size )
{
print "$url size was $size";
}
elsif( HTTP::Size::ERROR == $HTTP::Size::INVALID_URL )
{
print "$url is not a valid absolute URL";
}
elsif( HTTP::Size::ERROR == $HTTP::Size::COULD_NOT_FETCH )
{
print "Could not fetch $url\nHTTP status is $HTTP::Size::HTTP_STATUS";
}
elsif( HTTP::Size::ERROR == $HTTP::Size::BAD_CONTENT_LENGTH )
{
print "Could not determine content length of $url";
}
...gives me the popular 500 error. can anyone explain me what i do wrong here?
thank you in advance.
I got a little problem getting HTTP::Size to work:
Code:
#!/usr/bin/perl
use HTTP::Size;
my $url = "http://www.trempi.com";
my $size = HTTP::Size::get_size( $url );
print "Content-type: text/html\n";
if( defined $size )
{
print "$url size was $size";
}
elsif( HTTP::Size::ERROR == $HTTP::Size::INVALID_URL )
{
print "$url is not a valid absolute URL";
}
elsif( HTTP::Size::ERROR == $HTTP::Size::COULD_NOT_FETCH )
{
print "Could not fetch $url\nHTTP status is $HTTP::Size::HTTP_STATUS";
}
elsif( HTTP::Size::ERROR == $HTTP::Size::BAD_CONTENT_LENGTH )
{
print "Could not determine content length of $url";
}
...gives me the popular 500 error. can anyone explain me what i do wrong here?
thank you in advance.