Do you know where your variables are? | |
PerlMonks |
Re: How to combine string and digits in perlby davido (Cardinal) |
on Mar 17, 2021 at 13:48 UTC ( [id://11129827]=note: print w/replies, xml ) | Need Help?? |
The concatenation operator (dot), described in perlop, is not intended to be used inside a string. It is expected to join strings. So the following work:
But the following do not work, because dot inside a string is just a dot, not an operator:
What you want is one of the following:
I prefer option 1, 2 or 3. Option 2 is probably the most legible. Perl would probably make a lot more sense if you read perlintro, perlsyn, perlop, perlsub, and perldata. That's a couple hours worth of material, but it would move you forward in your learning curve. In perlop you can also read The Gory Details of Parsing Quote and Quote-like Constructs. Dave
In Section
Seekers of Perl Wisdom
|
|