in reply to Re: Conditional statements for template
in thread Conditional statements for template

""\${s_version/${exe}/$group"": another syntax error (mismatched braces).

I quite agree that the actual or intended semantics of it all are very puzzling, but FWIW at least this expression is syntactically correct:

c:\@Work\Perl\monks>perl -wMstrict -le "my ($exe, $group) = qw(foo bar); my $s = \"\${s_version/${exe}/$group\"; print qq{'$s'}; " '${s_version/foo/bar'

Replies are listed 'Best First'.
Re^3: Conditional statements for template
by kcott (Archbishop) on Mar 21, 2014 at 01:12 UTC

    Looking at it again, an escaped dollar sign could well be the intention (particularly in the context of a template).

    I suspect, making allowances for multiple typos, I assumed another (i.e. scalar vs. scalarref) when I got to those lines containing '\${'.

    However, if "\${version}/$group", "\${exe_state}" and "\${root}" are written as intended (i.e. generating "${version}/group_value", "${exe_state}" and "${root}" for subsequent evaluation via a template), then "\${s_version/${exe}/$group" is probably still missing a brace after 's_version'.

    Furthermore, I wonder why braces are used for ${exe} but not for $group: perhaps "\${s_version/${exe}/$group" is actually meant to be "\${s_version}\${exe}/$group" or "\${s_version}/\${exe}/$group" or <insert other guesses here>.

    Perhaps the OP will respond at some point and clarify the situation. :-)

    -- Ken

      Perhaps the OP will ... clarify the situation.

      We can only hope.