
big_v
New User
Sep 13, 2002, 1:20 AM
Post #1 of 3
(8634 views)
|
perl mysql cgi
|
Can't Post
|
|
I have a perl cgi script that when called will access a remote mysql database through an ssh tunnel (don't be alarmed!!). When I access the script with Netscape, the web server does not return the values form the mysql select. It's as if the web server timed out before mysql returns, and If I run it from the shell it works perfectly!! The problem isn't with mysql, as the example below should list the files in my home directory on the remote machine!! Again, this works from the shell!!
#!/usr/bin/perl -w use DBI; use strict; print"Content-type:text/html\n\n"; print_head(); foreach $_ (`ssh <ip address> ls -l`) { (my $1,my $2,my $3) = /(\S+)\s+(\S+)\s+(.*)/; print "$1 $2 $3<br>\n"; } print "<br><br>system call done\n"; print_tail(); sub print_head { print"<title>Title</title>"; print"<h2>output</h2>"; } sub print_tail { print"</body>\n"; print"</html>\n"; } All I get is a message saying 'system call done' (see code) and nothing else. Any ideas please!!?
|