OK, thanks for the replies. I hope my tone wasn't dismissive of anyone's suggestions, I certainly didn't mean to be and I am grateful for anyone taking the time to respond!
Here is some code. I pass a string from a webpage and I then need to bring up an ssh tunnel in the background (I know I could do this using some existing modules instead of the system call but I stumbled across this issues and I'd like to figure it out this way!
#!/usr/bin/perl
use strict;
use CGI;
use Frontier::Client;
use Template;
my $catch = $cgi->param("catch");
my $exec = 'ssh -T -N myname@myhost.myplace.me -i /home/user/.ssh/keys
+/login.key -p 2022 -L 1111:192.168.1.57:1111';
my $pid;
defined($pid = fork()) or die "We've go some forking trouble - $!\n";
if ($pid == 0) {
exec($exec);
die "No exec here and here's why: $!\n";
exit();
}
my $server = Frontier::Client->new(url => $catch,
);
my $name = $cgi->param("title");
my $cat = $cgi->param("category");
my $priority = "1";
my $Top = $server->boolean("0");
my $method = "appenurl";
my $u = $cgi->param("u");
my $i = $cgi->param("i");
my $r = $cgi->param("r");
my $url = "$u&$i&$r";
my $result = $server->call("appendurl",($name,$cat,$priority,$Top,$url
+) );
So, if I pass the CGI param via the command line I get the tunnel up and sits at the remote login prompt (after a sucessful login) it doesn't continue on to the XMLRPC part. In a browser, the headers (which I am calling from a templat e not included in this code) don't get printed, the script just hangs.
I am starting to think I am doing something really trivially, stupid at this stage?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.