Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix Perl script problem with Arrays

Status
Not open for further replies.

nuclearpond

Programmer
Feb 28, 2001
2
GB
Hi,

There is a perl script on out server which is called by a C program.

The script is failing every time it hits a line like this

@ArrayName=`ls -l /opt/app/axsys/dbconfig`;

As you can see, all it is doing is an ls -l on the file, and storing the result in the array. The perl then goes on to check the ownership and privlages of the file. Bypassing this (as its not essential) means the script stops at the next similar line, eg:

@ArrayName=`/opt/app/oracle/product......./query.sql $OracleUser $OraclePassword $OracleService`

This time its loading the results of the sql script into the array, and I cant bypass this. It seems to be a problem with either arrays, or executing Unix shell commands from within the perl.

I'm running perl 5 on and HP-UX 11 server
 
Are you sure the user who is running the code has read permissions in the first instance and execute permissions in the second???

If so, post the error messages so we can get some clues.




keep the rudder amid ship and beware the odd typo
 
The perl code is part of and application administration module, which is written in C. The code runs as the root user, and so permissions are not a problem. Just in case ive tried to change the permissions of the script etc.

If I run it from a unix prompt, it works OK, when it is called from within the C it uses a command pipe, and fails there.

I'm starting to think it may be a problem with the command pipe, as i've replaced the perl with an equivelant shell script and that wont run eiither, althogh a differnt error number is generated. Ive not had much experience with a mnas language like C, so am fed up with this now! Give me VB any day :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top