When using backtics to execute a command will variables be substituted correctly if placed within?
Yes, backticks (
qx) will interpolate variable values. As
Corion said, refer to
perlop.
$result = 'somecommand $filename';
Will the variable filename have it value substituted in or will it get interpreted literally as $filename?
You used single quotes (
q) in your example, not backticks. So, your question does not seem to match your example code. Since single quotes do not interpolate,
$result will contain the literal string
$filename, which you can easily prove to yourself by using
print to inspect its value, as
Corion also pointed out. You probably want:
$result = `somecommand $filename`;
or:
$result = qx(somecommand $filename);