Reputation: 11
I have a Java script (say) a.js that calls a Perl script b.pl by:
JavaScript:xmlhttpPost("http://:/cgi-bin/b.pl");
xmlhttpPost is something like:
function xmlhttpPost(strURL)
{
var xmlHttpReq=createXMLHttpRequest();
xmlHttpReq.open('POST', noCache(strURL), true);
where createXMLHttpRequest creates ActiveXObject
b.pl calls another perl module, c.pm. In c.pm, there is a piece of code to catch OS exception:
eval {
$ftp->put($filenamepath); };
if ($@) {
return "FTP time-out"; }
$ftp leverages Net::FTP.
If I run b.pl from command line and there is a time-out exception when using ftp to put a file, the excpetion was caught correctly. However, if b.pl is run via a.js, the time-out exception was not caught.
Please advise. Thanks!
Upvotes: 1
Views: 33