in reply to Switch.pm or possible alternatives

If all it does is evaluate a variable, then you might want to use a dispatch table... with a code-ref

Something like:

my %dispatch = ( value1 => \&code_A(); value2 => \&code_B(); value3 => \&code_C(); ); # and in your code: if (exists $dispatch{$somevar}) { $dispatch{$somevar}->(); }