I am trying to make a webpage from where people can run moss and check similarities in source code files.
For that I'm uploading the files via php and calling the moss script with those files as arguments using 'exec' in php, and dumping the output in a separate text file. The code works fine sometimes but sometimes it just stops after uploading the files.
Following is a snippet from the script
$server = 'moss.stanford.edu';
$port = '7690';
.
.
$sock = new IO::Socket::INET (
PeerAddr => $server,
PeerPort => $port,
Proto => 'tcp',
);
die "Could not connect to server $server: $!\n" unless $sock;
$sock->autoflush(1);
.
.
it is unable to create connection, and doesn't proceed beyond the fourth line in this snippet - 'die "Could not connect to server $server: $!\n" unless $sock;'
this doesn't happen all the time but, sometimes it works just fine and sometimes it doesn't.
But when I login to my webhost (which is btw godaddy), via ssh and execute the script in terminal with the same arguments, it always works!
Can someone please help me out with this, what's going wrong on the server sometimes that the script dies when executed through browser?
$!? What is$@say? A quirk of implementation (having to do with cross-platform timeout support, IIRC) means that IO::Socket::INET conveys errors in$@rather than$!. This is Inobviously Documented (tm) and a pity in my opinion, but so it is.