On Wed, 28 May 2003 22:42:32 -0700 (PDT), [EMAIL PROTECTED]
(Soumyadeep Nandi) wrote:

>>Maybe try to run it as a "system" command.
>
>>my $programtorun  =  'ls';
>>my @parameters    =  qw/. ../;
>>my @cmdline       =  ( $programtorun, @parameters );
>>system (@cmdline);
>
>>It can be a bit tricky getting all the parameters to
>your system >command
>>to be quoted properly, try a little experimentation.

>I've also tried as
>
>system ('water', 'water1.seq', 'water2.seq',
>'-gapopen', '10', '-gapextend', '5', '-outfile',
>'water.out');
>#system ('./water', 'water1.seq', 'water2.seq',
>'-gapopen 10', '-gapextend 5', '-outfile water.out');
>#system ('water', 'water1.seq', 'water2.seq',
>'-gapopen 10', '-gapextend 5', '-outfile water.out');
>
>But none worked.
>Is there is any permission problem.

If you think it's a permissions problem, just su
to the apache user, probably "nobody"; and
see if you can run the water command from the directory
your cgi runs in. That would be your first step,
demonstrating that you can create water.out as user
"nobody", running in the cgi-bin". 

Once that is done, you can work on getting the system
command parameters right. It would be easiest to setup
just a test script, that only runs the system('water',....)
command. And play with it, until you get water.out.

As an example of how tricky it can sometimes be, here is
an example of trying to set up a complex tar command with
system.

system ('tar','-c','-XEXCLUDE_FILE','-M','-L50000',"-F
./backup-rotate.pl $basename","-f$basename-0.tar",$dir);

Notice that for some reason these oddities:
--there is no space between -X and EXCLUDE_FILE 
--there is no space between -L and 50000
--there is no space between -f and $basename

I only got this to work by trial an error. It took me a couple 
of hours to figure it out. I never expected
that the way system read the parameters, that I could
not have a space between them. 

So, you need to figure out how your water program wants
it's parameters, and how that fits in with the way perl feeds
it from the parameter list. 

You might even find that your original way of using backticks
 might work, by capturing the output to a file:
$water.out = `water seq1 seq2 -gapopen 10`

You need to read the docs for water, maybe it needs a - to write
to stdout, or maybe it does it automatically.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to