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.
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:Will the variable filename have it value substituted in or will it get interpreted literally as $filename?$result = 'somecommand $filename';
or:$result = `somecommand $filename`;
$result = qx(somecommand $filename);
In reply to Re: Backtics and variables
by toolic
in thread Backtics and variables
by rpike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |