Home: Perl Programming Help: Intermediate:
501 HTTP not supported

New User

Jul 16, 2009, 11:47 AM

Views: 1005
501 HTTP not supported


I am trying to execute a perl script form my server with command

/usr/local/bin/perl /home/wlnprov/etc/Netcon_SOPMDD/sample.pl -url -file "batch.xml" -u a -p b
which give me the error

501 Protocol scheme 'http' is not supported

LWP is installed correctly I believe , testing of the below command gives me correct version, gives some error when not installed properly.

bash-2.05$ /usr/local/bin/perl -MLWP -le "print(LWP->VERSION)"

Where as the same command and the perl script is working fine from a different server a development server
and I am trying to deploy in live enviornment.

I have checked with the infrastructure guys and confirmed that the port opening is not an issue.

Thank you


use lib "/usr/local/lib/perl5/5.8.5";
use Getopt::Long;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;

# An example URL would be http://localhost:5960/xml/
$url = '';
$file = '';

# These are normal NetConductor user names and passwords.
$user = '';
$pass = '';

GetOptions('url=s' => \$url, 'file=s' => \$file, 'u=s' =>\$user, 'p=s' =>\$pass);
if (!$url)
die "Please specify a url.\n";
#print "Please specify a url.\n";

if (!$file)
#die "Please specify a file.\n";
print "Please specify a file.\n";

if (!$user)
#die "Please specify a user name.\n";
print "Please specify a user name.\n";

# Performs the POST action

$ua = new LWP::UserAgent;
$response = $ua->request(POST $url,Content_Type=>'form-data',Content=>[user=>$user,pass=>$pass,file=>["$file"]]);
#print $response->content();
#print "\n";
# Prints the response from the server
if ($response->is_success)
$message = $response->content();
print "$message .\n"

# This prints an error message if the script was unable to connect to the URL
print "$url is down.\n";
$message1 = $response->content();
print "$message1 .\n"


Jul 16, 2009, 12:22 PM

Views: 1003
Re: [seoulsoul] 501 HTTP not supported

Is there a firewall? It seems the HTTP protocol is being blocked, which may have nothing to do with your script.