Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: What was the programmer trying to accomplish?

by amir_e_a (Hermit)
on Jan 01, 2010 at 11:02 UTC ( #815165=note: print w/replies, xml ) Need Help??


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/|/;"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://815165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2023-03-22 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?