You need to use braces as you have with the other variables to detach the trailing underscore from the variable name.
use strict; use warnings; my $opstr = '01'; my $foo = "a_${opstr}_b"; print "$foo\n";
If you remove the braces even this short snippet will not compile.
🦛
In reply to Re: appending a variable
by hippo
in thread appending a variable
by pragovnj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |