http://qs1969.pair.com?node_id=815165


in reply to What was the programmer trying to accomplish?

This is only a guess, but it's quite possible that your predecessor tried to construct a string that will be later used as shell command, that runs the script 'pers_lookup.csh' and passes it as an argument the value of the $sids[$index] variable. Sometimes later in the program there's probably a line that goes something like this:

system $isacon;

or maybe:

$isacon_output = `$isacon`; # (Notice the single back quotes.)

The way the code is currently written, it will probably not work, because it will literally use the string '$sids[$index]' as the argument. Of course, i don't know anything about your environment, so it's actually possible that it has some meaning to your shell.

You can try, very carefully, to replace the single quotes with double quotes, so the value of $sids[$index] will be actually used:

$isacon = "/apps/home/pfuser/scripts_56/GENERAL/pers_lookup.csh $sids[ +$index]"; print "isacon value: [$isacon]\n"; exit;

Run it, and if the isacon value that appears between the square brackets makes sense as a shell command in your environment, remove the lines with 'print' and 'exit'. Again, be very careful, because it may do unexpected things to your environment.

Replies are listed 'Best First'.
Re^2: What was the programmer trying to accomplish?
by kirkbrown (Novice) on Jan 01, 2010 at 15:03 UTC
    I thinks that is it! Thank you. He was making a direct assignment to "$isacon" by executing a unix script. The script got its valuse from "$sidsindex. He later used the value of "$isacon" as such "$isacon ~= tr/\n/|/;"