satya_rockstar has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to modify existing perl code and I would like to add an option to it. But there is a glitch here as there I have to go one elevel down. This levelling is conditional. The code :
use GetOpt::Long; my template ={ "global" => { "variables" =>{ "version" => "${s_version}", if($s_version eq "s8") "base" => "\${version}/$group", else{ "exe" => "\${exe_state}", "base" => "\${s_version/${exe}/$group" , } "variant" => "10", "dir" => "\${root}" } }}}
How do I break the if . I know I cant use a if in a template. How do I break it ? I think u can use hashing here. Biut, I don't know how to implement it. Can anybody give me a lead?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Conditional statements for template
by graff (Chancellor) on Mar 20, 2014 at 03:22 UTC | |
|
Re: Conditional statements for template
by kcott (Archbishop) on Mar 20, 2014 at 04:38 UTC | |
by AnomalousMonk (Archbishop) on Mar 20, 2014 at 17:12 UTC | |
by kcott (Archbishop) on Mar 21, 2014 at 01:12 UTC | |
by AnomalousMonk (Archbishop) on Mar 21, 2014 at 02:09 UTC | |
|
Re: Conditional statements for template
by choroba (Cardinal) on Mar 20, 2014 at 10:24 UTC | |
|
Re: Conditional statements for template
by Anonymous Monk on Mar 20, 2014 at 02:38 UTC |