in reply to Is this an efficient way check for certain conditions?

In the case where you only have two or three cases, this works fine. If you have a case where you have many conditions you can use a dispatch table as such.
my %dispatch = ('foo_1' => \&bar, 'foo_2' => \&foo_2, 'bar_3' => \&foo_2, 'bar_4' => \&foo_2, 'blah_5' => \&foo_2, 'default' => \&default, ); (defined $dispatch{$value}) ? &{$dispatch{$value}}() : &{$dispatch{'default'}}();