[Kc] Executing third party tools using CGI/Perl

Eric Wilhelm scratchcomputing at gmail.com
Tue Jan 17 18:10:29 PST 2006


# from Frank Wiles
# on Tuesday 17 January 2006 05:44 pm:

> Yeah this shouldn't be a big deal.  Try using backticks instead of
>  system like:
> 
>  `/full/path/to/svn_classify $input $model $output`;

Then cross your fingers and wish real hard that $output doesn't contain 
the string "; rm -rf /"  :-)

Try IPC::Run, which allows you to capture output, but also make sure 
that you exec the command in the less promiscuous list context.

  use IPC::Run qw(run);
  my ($in, $out, $err);
  run(['/full/path/to/svn_classify', $input, $model, $output], 
    \$in, \$out, \$err);

--Eric
-- 
Minus 1 million points for not setting your clock forward and trying the
code.
--Michael Schwern
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------


More information about the kc mailing list