Using PerlScript In ASP

K

KaXo

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?
 
W

Will Stranathan

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
}
 
K

KaXo

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top