print "2+2" doesn't print 4.
print "2.2" doesn't print 22.
You can't place Perl code in Perl string literals and except it to get executed when the string is accessed.
That's why you were directed to use interpolation (a feature of string literals) instead of the concatenation operator (a Perl operator).
In reply to Re: opening files where name is a concatenation of variable
by ikegami
in thread opening files where name is a concatenation of variable
by confused_newbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |