Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am having the great joy of figuring out someone else code. And I haven't seen this before ...
$tests->{$stype} ||= {}; my %tests = %{$tests->{$stype}};
... what the heck would that code be trying to do?
The $test is a big ugly global hash ref at the top of the code that is about 100 lines long so I will only post a small version that might have typos in it here:
my $tests = { all => { cost => \&cost_checker }, YEAM => { lipmons => sub { check_lipmons(@_, 'SD' => 3, 'ron' => 2, 'SP' => 3); }, dd => \&check_dd, stype => sub { check_stypes(@_, "EM"); }, heat_monr => sub { check_heatmonr(@_, 1); }, heat_pgm => sub { check_hpgm(@_, 'Solar'); }, }, ...
Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: What the heck does "tests->{$stype} ||= {};" do?
by kyle (Abbot) on Sep 19, 2008 at 19:40 UTC | |
by Bloodnok (Vicar) on Sep 20, 2008 at 10:38 UTC | |
by ikegami (Patriarch) on Sep 20, 2008 at 11:23 UTC | |
by Bloodnok (Vicar) on Sep 20, 2008 at 13:34 UTC | |
Re: What the heck does "tests->{$stype} ||= {};" do?
by jwkrahn (Abbot) on Sep 19, 2008 at 19:39 UTC |