Help - Search - Members - Calendar
Full Version: LWP::Simple Question
Hostony Board > General Support > General Support
Remi
This is possibly just me being an idiot; or it could be a misconfiguration... correct me if I am wrong, but shouldn't the following work?

jailshell-2.05a$ perl -MLWP::Simple -e "getprint('http://www.google.com');"

Instead, I get the error:
500 Can't connect to www.google.com:80 (Bad protocol 'tcp') <URL:http://www.google.com>

Bad protocol? Is LWP set up correctly? Or am I doing something horribly, horribly wrong?

P.S. I have seen some notes in the forums harranguing you guys regarding the recent locking-down of the shell. I have to say that I like it - previously when I had logged in I was not happy with the prospect of having my files accessible to others (and yet was unable to CHMOD them to be inaccessible to others whilst still allowing them to be accessed by Apache). Good to see that you guys are working towards keeping people out of each other's way :wink:.

Thanks.
Shurik
Hello.

I've tried on some servers this example
perl -MLWP::Simple -e 'getprint "http://www.sn.no"'

(from http://search.cpan.org/author/GAAS/libwww-.../LWP/Simple.pm)

And it does work.
QUOTE
perl -MLWP::Simple -e 'getprint "http://www.sn.no"'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html><head>
<title>Skogeierforeninga Nord</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="112,*,22" frameborder="NO" border="0" framespacing="0">
<frame name="topp" scrolling="NO" noresize src="topp.html" frameborder="NO" >
<frameset cols="170,*" frameborder="NO" border="0" framespacing="5">
<frame name="meny" scrolling="NO" noresize src="menu/meny.asp" frameborder="NO">
<frame name="hoved" src="intro.asp" frameborder="NO">
</frameset>

<frame name="bunn" scrolling="NO" noresize src="bunn.html" frameborder="NO">
</frameset><noframes></noframes></html>


Anyway please make a request to support@hostony.com and provide me your domain name. I'll check the server where your site is located.
orenlevin
[quote="Remi"]This is possibly just me being an idiot; or it could be a misconfiguration... correct me if I am wrong, but shouldn't the following work?

jailshell-2.05a$ perl -MLWP::Simple -e "getprint('http://www.google.com');"

Instead, I get the error:
500 Can't connect to www.google.com:80 (Bad protocol 'tcp') <URL:http://www.google.com>
quote]

Try switching your single quotes and double quotes:
perl -MLWP::Simple -e 'getprint("http://www.google.com");'

That should get you a bit further.

Oren
Remi
The quotes don't make a difference (in this case) - I tried it just to be sure, but

perl -MLWP::Simple -e "getprint('http://www.google.com');"
and
perl -MLWP::Simple -e 'getprint("http://www.google.com");'

do exactly the same thing, just as they should - the outside quotes are parsed by the shell and control shell-based interpretation of variables inside the quoted expression (of which there are none, so it doesn't matter which quotes you use); and the inner set of quotes control perl-based interpretation of variables inside the quoted expression (again, of which there are none, so it doesn't matter what quotes you use).

It's kind of inconsequential anyways, as Hostony has fixed the problem.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2025 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here