Using PerlScript In ASP

Discussion in 'Perl' started by KaXo, Mar 1, 2004.

  1. KaXo

    KaXo Guest

    I use PerlScript in ASP, where got a Error, IIS will send the Error
    messenge to client. how to resume asp running? my asp need to handle
    the errors.

    For Example:
    $r_socket = IO::Socket::INET->new(
    PeerAddr => $host,
    PeerPort => $port,
    Proto => 'tcp',
    Timeout => 4);

    where $host was closed, IIS will return "HTTP 500 - Internal server
    error".
    Error in IIS log is "|2|80004005|IO::Socket::INET:_connect:_Unknown_error".

    there is "on err resume next" in vbscript. and perlscript?
     
    KaXo, Mar 1, 2004
    #1
    1. Advertising

  2. (KaXo) wrote in message news:<>...
    > I use PerlScript in ASP, where got a Error, IIS will send the Error
    > messenge to client. how to resume asp running? my asp need to handle
    > the errors.
    >
    > For Example:
    > $r_socket = IO::Socket::INET->new(
    > PeerAddr => $host,
    > PeerPort => $port,
    > Proto => 'tcp',
    > Timeout => 4);
    >
    > where $host was closed, IIS will return "HTTP 500 - Internal server
    > error".
    > Error in IIS log is "|2|80004005|IO::Socket::INET:_connect:_Unknown_error".
    >
    > there is "on err resume next" in vbscript. and perlscript?


    either eval or do checking on $r_socket the next line:

    eval {
    $r_socket = IO::Socket::INET->new(
    # etc
    );
    };

    if the error is on the IO::Socket::INET->new line, or:

    $r_socket = IO::Socket::INET->new(
    # etc
    );
    if (! defined $r_socket) {
    $Response->Write("<b>Client disconnected</b>");
    } else {
    # do something with $r_socket
    }
     
    Will Stranathan, Mar 2, 2004
    #2
    1. Advertising

  3. KaXo

    KaXo Guest

    (Will Stranathan) wrote in message news:<>...
    > (KaXo) wrote in message news:<>...
    > > I use PerlScript in ASP, where got a Error, IIS will send the Error
    > > messenge to client. how to resume asp running? my asp need to handle
    > > the errors.
    > >
    > > For Example:
    > > $r_socket = IO::Socket::INET->new(
    > > PeerAddr => $host,
    > > PeerPort => $port,
    > > Proto => 'tcp',
    > > Timeout => 4);
    > >
    > > where $host was closed, IIS will return "HTTP 500 - Internal server
    > > error".
    > > Error in IIS log is "|2|80004005|IO::Socket::INET:_connect:_Unknown_error".
    > >
    > > there is "on err resume next" in vbscript. and perlscript?

    >
    > either eval or do checking on $r_socket the next line:
    >
    > eval {
    > $r_socket = IO::Socket::INET->new(
    > # etc
    > );
    > };
    >
    > if the error is on the IO::Socket::INET->new line, or:
    >
    > $r_socket = IO::Socket::INET->new(
    > # etc
    > );
    > if (! defined $r_socket) {
    > $Response->Write("<b>Client disconnected</b>");
    > } else {
    > # do something with $r_socket
    > }


    thank you very much. it works fine now.
     
    KaXo, Mar 3, 2004
    #3
    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. tuspa
    Replies:
    0
    Views:
    664
    tuspa
    Jul 20, 2007
  2. tuspa
    Replies:
    0
    Views:
    2,672
    tuspa
    Jul 20, 2007
  3. Replies:
    3
    Views:
    183
    Bob Barrows [MVP]
    Jan 25, 2006
  4. Brian

    Need help with PerlScript (asp).

    Brian, Jul 14, 2004, in forum: Perl Misc
    Replies:
    5
    Views:
    147
    ChrisO
    Jul 17, 2004
  5. LinnAxis
    Replies:
    9
    Views:
    158
    Tad McClellan
    Jan 27, 2005
Loading...

Share This Page