LWP and speedstream router

K

KenK

Hi all,

I'm trying to use LWP on one of my Linux servers to reboot the speedstream
5200 router.

I'm sorta stuck at the authorization stage. (ie beginning).
One of the things I've tried is the following;

#!/usr/bin/perl

use HTTP::Request::Common qw/POST/;

$req = POST http://192.168.254.254;
$req->authorization_basic("user","pass");

use LWP;

my $browser = LWP::UserAgent->new;

$res = $browser->request($req);


Essentially the script just hangs. Any suggestions would be greatly
appreciated.

Thanks,
Ken
 
P

Paul Lalli

KenK said:
Hi all,

I'm trying to use LWP on one of my Linux servers to reboot the speedstream
5200 router.

I'm sorta stuck at the authorization stage. (ie beginning).
One of the things I've tried is the following;

#!/usr/bin/perl

you forgot
use strict;
use warnings;

Those two statements are vital to solving your Perl problems without
asking hundreds of people.

Have you read the posting guidelines for this newsgroup?
use HTTP::Request::Common qw/POST/;

$req = POST http://192.168.254.254;
$req->authorization_basic("user","pass");

use LWP;

my $browser = LWP::UserAgent->new;

$res = $browser->request($req);

When I run this script, I get:

Number found where operator expected at lwp.pl line 5, near
"//192.168.254.254"
(Missing operator before 192.168.254.254?)
syntax error at lwp.pl line 5, near "http:"
BEGIN not safe after errors--compilation aborted at lwp.pl line 8.

Please post the code you're actually running, not something that
aproximates it.

Have you read the posting guidelines for this newsgroup?
Essentially the script just hangs. Any suggestions would be greatly
appreciated.

Please read the posting guidelines to
1) Learn how to help yourself
2) Learn how to help others help you.

Paul Lalli
 
K

KenK

Paul Lalli said:
you forgot
use strict;
use warnings;

Those two statements are vital to solving your Perl problems without
asking hundreds of people.

Have you read the posting guidelines for this newsgroup?


When I run this script, I get:

Number found where operator expected at lwp.pl line 5, near
"//192.168.254.254"
(Missing operator before 192.168.254.254?)
syntax error at lwp.pl line 5, near "http:"
BEGIN not safe after errors--compilation aborted at lwp.pl line 8.

Please post the code you're actually running, not something that
aproximates it.

Have you read the posting guidelines for this newsgroup?


Please read the posting guidelines to
1) Learn how to help yourself
2) Learn how to help others help you.

Paul Lalli

Thank you for the reponse. Responses such as "did you read the posting
guidelines" is one reason I left the perl community years ago. I have
spent many many hours reading various articles over the last two days in an
attempt to "help myself" with regards to LWP. While I don't consider this
time to be wasted since I was picking up other tidbits of information during
the process, I do feel there must be a point when you have to finally give
in and simply "ask the question". A good portion of this time was using
google's group search feature which is where I found out about the use of
LWP in the first place. It's amazing that my first post back into the perl
community forums in over 5 years would result in a "did you read the posting
guidelines?" response. But to answer your question, no I did not read the
"posting guidelines" as I was already at the frustration point and stepping
into the "wasting time" arena. I do apologize for not doing so, however,
unless it is beyond my control, I'll probably avoid the perl community for
another 5-10 years.

But again, thank you for the response.

Best regards,
Ken
 
P

Paul Lalli

Thank you for the reponse. Responses such as "did you read the posting
guidelines" is one reason I left the perl community years ago. I have
spent many many hours reading various articles over the last two days in an
attempt to "help myself" with regards to LWP. While I don't consider this
time to be wasted since I was picking up other tidbits of information during
the process, I do feel there must be a point when you have to finally give
in and simply "ask the question". A good portion of this time was using
google's group search feature which is where I found out about the use of
LWP in the first place. It's amazing that my first post back into the perl
community forums in over 5 years would result in a "did you read the posting
guidelines?" response.

Yes, it is amazing. You'd think within those five years, you might
have been able to find 10 minutes to read them. You have pretty
clearly demonstrated that your time is far more valuable than that of
the people from whom you seek help.
But to answer your question, no I did not read the
"posting guidelines" as I was already at the frustration point and stepping
into the "wasting time" arena. I do apologize for not doing so, however,
unless it is beyond my control, I'll probably avoid the perl community for
another 5-10 years.

Fare thee well.

Paul Lalli
 
J

John Bokma

KenK said:
Thank you for the reponse. Responses such as "did you read the
posting guidelines" is one reason I left the perl community years ago.

Because you got them all the time? The response is justified, you posted
not working Perl code. What do you want the community to do for you?

Debug it and fix it?

Are you out of your mind?

Also Paul gave you excellent advice: use warnings; and use strict; it might
save you hours and hours in the future.
It's amazing that my first post back into the perl community forums in
over 5 years would result in a "did you read the posting guidelines?"

It's amazing that in 5 years you still haven't learned how to post working
code.
 
T

Tad McClellan

KenK said:
Thank you for the reponse. Responses such as "did you read the posting
guidelines" is one reason I left the perl community years ago.


Why would that make you leave the community?

The guidelines describes things that you should, and should not, do to
increase your chances of getting an answer to your Perl question.

Do you prefer a lesser chance of getting an answer for some reason?

I have
spent many many hours reading various articles over the last two days in an
attempt to "help myself" with regards to LWP.


Thank you.

I do feel there must be a point when you have to finally give
in and simply "ask the question".


Of course, but nobody said that you should not have asked the question...

It's amazing that my first post back into the perl
community forums in over 5 years would result in a "did you read the posting
guidelines?" response.


Why is that amazing?

It was apparent that you did not know several of the points that are
made in the guidelines.

We are a helpful lot, so somebody tried to help you learn what
you did not know.

But to answer your question, no I did not read the
"posting guidelines" as I was already at the frustration point and stepping
into the "wasting time" arena.


Not reading them was stepping into the "wasting time" arena, since
they describe ways to help with getting help.

By not following the guidelines you have illustrated that you feel
that your time is more important than the combined time of thousands
of your peers.

That is likely to reduce the chances of you getting an answer to
your Perl question.

I do apologize for not doing so,


There are surely some here who are gullible enough to believe that.

however,
unless it is beyond my control, I'll probably avoid the perl community for
another 5-10 years.


Thank you for doing what you could to make our newsgroup a better place.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top