in reply to Why is this string only PARTIALLY interpolated?
The first string literal uses single quotes. These don't interpolate.
The second string contains $_ and $y. Both were interpolated.
$x was read in from mysql and the value in it is not interpolated.
What I hear is that you stored incomplete Perl code (partial string literals) in the database as a template.
Some earlier posts show how to attempt to fix the incomplete Perl code (by adding double quotes) and how to execute that code (by using eval EXPR). But this isn't a good idea.
The better solution is to use a proper template system!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is this string only PARTIALLY interpolated?
by misterperl (Friar) on Aug 04, 2023 at 12:52 UTC | |
by hippo (Archbishop) on Aug 04, 2023 at 15:47 UTC | |
by misterperl (Friar) on Aug 09, 2023 at 13:40 UTC | |
by ikegami (Patriarch) on Aug 05, 2023 at 06:05 UTC | |
by misterperl (Friar) on Aug 09, 2023 at 13:48 UTC | |
by cavac (Prior) on Aug 09, 2023 at 14:46 UTC |