looking for help with script (what's new?)

Discussion in 'Perl Misc' started by leepincat, Jan 7, 2011.

  1. leepincat

    leepincat Guest

    I don't know scripting from Chinese. I'm trying to do a little
    research for someone as an act of human kindness.
    I don't know if it's difficult, or a simple thing.... hoping if
    someone knows how to do this without a lot of effort and time, that
    would be great. If I'm off base, ....I tried.
    (I don't even know if I'm in the "correct" group.

    Is the following something that can be done with PERL?
    Could you post some examples? Again, if this is too much to ask, I
    apoligize in advance- Donna

    1. Code must compile/run without errors
    2. It takes arguments for: timeout, url, expected_response_code,
    retry_count
    3. The script performs an HTTP GET for the url
    4. If the HTTP response code matches the expected_response_code the
    script will exit with status code 0
    5. If the HTTP response code doesn't match exit with a nonzero status
    code and print an error
    6. If the HTTP GET either times out or fails in another way
    (connection
    refused, etc.) retry until retry count is exhausted
    7. If all retries are exhausted without a success, print a message
    to STDERR and exit with a non-zero status code.
    leepincat, Jan 7, 2011
    #1
    1. Advertising

  2. leepincat

    leepincat Guest

    On Jan 6, 10:34 pm, Sherm Pendley <> wrote:
    > leepincat <> writes:
    > > I don't know scripting from Chinese. I'm trying to do a little
    > > research for someone as an act of human kindness.

    >
    > What part of "we don't do your homework for you" did you not understand
    > when you posted the SAME question in another group?
    >
    > sherm--
    >
    > --
    > Sherm Pendley
    >                                    <http://camelbones.sourceforge.net>
    > Cocoa Developer
    leepincat, Jan 7, 2011
    #2
    1. Advertising

  3. leepincat

    leepincat Guest

    On Jan 6, 9:37 pm, leepincat <> wrote:
    > I don't know scripting from Chinese. I'm trying to do a little
    > research for someone as an act of human kindness.
    >  I don't know if it's difficult, or a simple thing.... hoping if
    > someone knows how to do this without a lot of effort and time, that
    > would be great. If I'm off base, ....I tried.
    > (I don't even know if I'm in the "correct" group.
    >
    > Is the following something that can be done with PERL?
    > Could you post some examples?  Again, if this is too much to ask, I
    > apoligize in advance- Donna
    >
    >  1. Code must compile/run without errors
    >  2. It takes arguments for: timeout, url, expected_response_code,
    >    retry_count
    >  3. The script performs an HTTP GET for the url
    >  4. If the HTTP response code matches the expected_response_code the
    >    script will exit with status code 0
    >  5. If the HTTP response code doesn't match exit with a nonzero status
    >    code and print an error
    >  6. If the HTTP GET either times out or fails in another way
    > (connection
    >    refused, etc.) retry until retry count is exhausted
    >  7. If all retries are exhausted without a success, print a message
    >    to STDERR and exit with a non-zero status code.



    I was hoping someone in this group might be a bit more open minded.
    Simply trying to help someone out as I explained.... I don't know
    why that upsets you. Maybe it's "acts of human kindness" you're not
    familiar with. You should try it sometime. -dj
    leepincat, Jan 7, 2011
    #3
  4. leepincat

    Uri Guttman Guest

    >>>>> "l" == leepincat <> writes:

    l> I was hoping someone in this group might be a bit more open minded.
    l> Simply trying to help someone out as I explained.... I don't know
    l> why that upsets you. Maybe it's "acts of human kindness" you're not
    l> familiar with. You should try it sometime. -dj

    and you should ask for a pony if you have that attitude. this group is
    to help people with perl issues, not code for them. if you want coding
    done, go to jobs.perl.org and post a paying job.

    what you have asked for is way beyond a simple little script. it is
    called work.

    uri

    --
    Uri Guttman ------ -------- http://www.sysarch.com --
    ----- Perl Code Review , Architecture, Development, Training, Support ------
    --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
    Uri Guttman, Jan 7, 2011
    #4
  5. leepincat

    Keith Keller Guest

    On 2011-01-07, leepincat <> wrote:
    >
    > 1. Code must compile/run without errors


    perldoc strict

    > 2. It takes arguments for: timeout, url, expected_response_code,
    > retry_count


    perldoc perlfunc

    > 3. The script performs an HTTP GET for the url


    perldoc LWP

    > 4. If the HTTP response code matches the expected_response_code the
    > script will exit with status code 0


    perldoc -f exit

    > 5. If the HTTP response code doesn't match exit with a nonzero status
    > code and print an error


    perldoc -f warn

    > 6. If the HTTP GET either times out or fails in another way
    > (connection
    > refused, etc.) retry until retry count is exhausted


    perldoc perlsyn

    > 7. If all retries are exhausted without a success, print a message
    > to STDERR and exit with a non-zero status code.


    perldoc perlsyn
    perldoc -f warn
    perldoc -f exit
    perldoc perl

    Good luck.

    --keith

    --
    -francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information
    Keith Keller, Jan 7, 2011
    #5
  6. leepincat

    leepincat Guest

    On Jan 7, 1:02 am, Keith Keller <-
    francisco.ca.us> wrote:
    > On 2011-01-07, leepincat <> wrote:
    >
    >
    >
    > >  1. Code must compile/run without errors

    >
    > perldoc strict
    >
    > >  2. It takes arguments for: timeout, url, expected_response_code,
    > >    retry_count

    >
    > perldoc perlfunc
    >
    > >  3. The script performs an HTTP GET for the url

    >
    > perldoc LWP
    >
    > >  4. If the HTTP response code matches the expected_response_code the
    > >    script will exit with status code 0

    >
    > perldoc -f exit
    >
    > >  5. If the HTTP response code doesn't match exit with a nonzero status
    > >    code and print an error

    >
    > perldoc -f warn
    >
    > >  6. If the HTTP GET either times out or fails in another way
    > > (connection
    > >    refused, etc.) retry until retry count is exhausted

    >
    > perldoc perlsyn
    >
    > >  7. If all retries are exhausted without a success, print a message
    > >    to STDERR and exit with a non-zero status code.

    >
    > perldoc perlsyn
    > perldoc -f warn
    > perldoc -f exit
    > perldoc perl
    >
    > Good luck.
    >
    > --keith
    >
    > --
    > -francisco.ca.us
    > (try just my userid to email me)
    > AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    > see X- headers for PGP signature information


    Thank-You VERY much for the constructive response !
    Truly appreciated - Donna K
    leepincat, Jan 7, 2011
    #6
  7. leepincat

    Steve C Guest

    On 01/07/2011 12:37 AM, leepincat wrote:
    > I don't know scripting from Chinese. I'm trying to do a little
    > research for someone as an act of human kindness.
    > I don't know if it's difficult, or a simple thing.... hoping if
    > someone knows how to do this without a lot of effort and time, that
    > would be great. If I'm off base, ....I tried.
    > (I don't even know if I'm in the "correct" group.
    >
    > Is the following something that can be done with PERL?
    > Could you post some examples? Again, if this is too much to ask, I
    > apoligize in advance- Donna
    >
    > 1. Code must compile/run without errors
    > 2. It takes arguments for: timeout, url, expected_response_code,
    > retry_count
    > 3. The script performs an HTTP GET for the url
    > 4. If the HTTP response code matches the expected_response_code the
    > script will exit with status code 0
    > 5. If the HTTP response code doesn't match exit with a nonzero status
    > code and print an error
    > 6. If the HTTP GET either times out or fails in another way
    > (connection
    > refused, etc.) retry until retry count is exhausted
    > 7. If all retries are exhausted without a success, print a message
    > to STDERR and exit with a non-zero status code.



    If all you want is the response code you should do HEAD, not GET.
    Perl is an excellent choice for doing this.
    Steve C, Jan 7, 2011
    #7
  8. leepincat

    ccc31807 Guest

    Perl is know informally as the glue of the internet. It was at one
    time very widely used for server side programming. If your
    requirements are any indication, Perl is a good choice. Of course, if
    you are masochistic, you could also use C, VB, or even ASM.

    You can find examples of your needs by using Google or equivalent. You
    can purchase 'Perl and LWP' by Sean Burke for less than $10.00. Also,
    'Network Programming with Perl' by Linclon Stein is also very good. Of
    course, you might want to try reading 'Learning Perl' by Randal
    Schwartz first.

    On Jan 7, 12:37 am, leepincat <> wrote:
    > Is the following something that can be done with PERL?
    >  1. Code must compile/run without errors


    Yes, it's possible for Perl code to run without errors.

    >  2. It takes arguments for: timeout, url, expected_response_code,
    >    retry_count


    Yes, Perl scripts can take arguments, either from the command line or
    interactively.

    >  3. The script performs an HTTP GET for the url


    Yes, you can retrieve web pages with Perl.

    >  4. If the HTTP response code matches the expected_response_code the
    >    script will exit with status code 0


    Yes, you can test the response code and conditionally exit.

    >  5. If the HTTP response code doesn't match exit with a nonzero status
    >    code and print an error


    Yes, see above.

    >  6. If the HTTP GET either times out or fails in another way
    > (connection
    >    refused, etc.) retry until retry count is exhausted


    Yes, this is normally called a loop.

    >  7. If all retries are exhausted without a success, print a message
    >    to STDERR and exit with a non-zero status code.


    Yes.

    CC
    ccc31807, Jan 10, 2011
    #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. Rajat
    Replies:
    3
    Views:
    689
    Jorgen Grahn
    Jan 8, 2010
  2. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    551
    Jan Kaliszewski
    Jan 7, 2010
  3. Mark
    Replies:
    9
    Views:
    171
    Patrick Hurley
    Mar 10, 2006
  4. P2P
    Replies:
    2
    Views:
    111
  5. Replies:
    2
    Views:
    449
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page