My example is different from your snippet in many little details - I was very confused by your use of back-slashes, dollar-signs and curly brackets inside of double-quotes, because it seemed strange and inconsistent. I simplified things, assuming that you probably have variables like "$group" and "$exe" defined somewhere else in your code, and you want those values used inside the quotes.my $template = { global => { variables => { version => "$s_version", variant => "10", dir => "$root", } } }; if ( $s_version eq "s8" ) { $template{global}{base} = "$version/$group"; } else { $template{global}{exe} => "$exe_state", $template{global}{base} => "$s_version/$exe/$group" , }
Your use of curly brackets outside of quotes was also pretty confused.
If you're not sure about the proper syntax to get what you want, please try to describe in better detail what you want, and maybe show us a bit more of your code, too. Or add just enough to the current snippet so that it should do something (like print something out).
In reply to Re: Conditional statements for template
by graff
in thread Conditional statements for template
by satya_rockstar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |