Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^2: What was the programmer trying to accomplish?

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

in reply to Re: What was the programmer trying to accomplish?
in thread What was the programmer trying to accomplish?

Indeed, maybe backticks (``) could be used on this line directly:

$isacon = `/apps/home/pfuser/scripts_56/GENERAL/pers_lookup.csh $sids[$index]`;

Backticks, like the double quotes (""), interpolate the string, which means that they translate every variable to its value. Then they run the string as a shell command and return the output.

Since you are not sure about the programmer's intention, you should still test it first with double quotes and check the result, for example by printing it, and only then you should run it with backticks or system.

Read more about all the different types of quotes here: Quote-like Operators in perlop.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2023-12-08 03:01 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (35 votes). Check out past polls.