LWP and speedstream router

Discussion in 'Perl Misc' started by KenK, Jul 1, 2005.

  1. KenK

    KenK Guest

    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
    KenK, Jul 1, 2005
    #1
    1. Advertising

  2. KenK

    Paul Lalli Guest

    KenK wrote:
    > 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
    Paul Lalli, Jul 1, 2005
    #2
    1. Advertising

  3. KenK

    KenK Guest

    "Paul Lalli" <> wrote in message
    news:...
    > KenK wrote:
    >> 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
    >


    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
    KenK, Jul 1, 2005
    #3
  4. KenK

    Paul Lalli Guest

    KenK wrote:
    > "Paul Lalli" <> wrote in message
    > news:...
    > > KenK wrote:
    > >> 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?


    > 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
    Paul Lalli, Jul 1, 2005
    #4
  5. KenK

    John Bokma Guest

    "KenK" <> wrote:

    > 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.

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
    John Bokma, Jul 1, 2005
    #5
  6. "KenK" <> wrote in
    news:66069$42c59b0e$438ce4af$:


    > Responses such as "did you read the posting guidelines" is one
    > reason I left the perl community years ago.


    Nice not knowing you.

    *PLONK*

    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
    A. Sinan Unur, Jul 1, 2005
    #6
  7. KenK <> wrote:
    > "Paul Lalli" <> wrote in message
    > news:...



    > 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.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Jul 1, 2005
    #7
  8. KenK <> wrote:

    > $req = POST http://192.168.254.254;


    > Any suggestions would be greatly
    > appreciated.



    Put quotes around strings.

    Enable warnings.

    Enable strict.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Jul 1, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    using VS with an AD server and a Broadband router

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, May 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    335
    =?Utf-8?B?ZGhucml2ZXJzaWRl?=
    May 9, 2005
  2. kashumoto_tokugawa
    Replies:
    1
    Views:
    1,697
  3. Replies:
    23
    Views:
    764
    Christian H
    Jun 21, 2007
  4. Lloyd Sheen
    Replies:
    12
    Views:
    742
    Juan T. Llibre
    Mar 28, 2009
  5. George Hester

    ASP and Router

    George Hester, Apr 7, 2006, in forum: ASP General
    Replies:
    2
    Views:
    102
    George Hester
    Apr 8, 2006
Loading...

Share This Page