Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Perl's problem with running an external program

Posted on 1997-07-26
5
Medium Priority
?
192 Views
Last Modified: 2013-12-25
Dear Perl experts,

I am trying to execute an external program through a perl script. This script creates a file, updates a file, and creates an HTML page on the fly. The script then needs to run a program called 'waisindex' to create several files. Waisindex works ok if it is run from the Unix command line. A file permission of 'sum_$id_value[1].txt' is 644, but other's permissions are 755. The related part of the script is as follows:
--------
.
.
.
`/home/dcs0ock/bin/waisindex -t fields -d /home/dcs0ock/wsdb/sear -a /home/dcs0ock/public_html/terra/summary/sum_$id_value[1].txt`;
--------------
0
Comment
Question by:dcs0ock
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Expert Comment

by:icd
ID: 1829420
Not too sure about this, hence the comment rather than the answer.

You don't say what the actual error reported is.

Remember that as a user accessing the script through a web browser you will have a different user name (something like 'nobody'). Presumably you will have a different 'home' directory as a consequence. Could this be your problem?

0
 

Author Comment

by:dcs0ock
ID: 1829421
The actual error of the perl script is that a part related to
'waisindex' of a perl script would not be run. The script has
been used as a CGI script without any problem and I've added the part of 'waisindex' to the script. The other parts of the script except a 'waisindex' part shown in the above question are normally run ok. Thus, it seems to me that this problem is not
concerned with a different user name or different 'home' directory. Have you got any clue?

Thank a lot.
0
 
LVL 2

Expert Comment

by:n3mtr
ID: 1829422
Try putting the waisindex command inside a system call instead of using backticks.
ex:
system("/directory/waisindex options");

0
 

Author Comment

by:dcs0ock
ID: 1829423
Edited text of question
0
 
LVL 3

Accepted Solution

by:
pc012197 earned 50 total points
ID: 1829424
Try to separate the three commands with semicolons instead of just newlines.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question