Route a command through scalar branch logic while replay shows the selected path.

Dispatcher Branch Panel

dispatcher_branch_panel.pl
use strict;
use warnings;

my $mode = ;
my $access = "ok";
my $handled = "";

if ($mode eq "refresh") {
    $handled = "cache:" . $mode;
} elsif ($mode eq "archive") {
    $access = "review";
    $handled = "queue:" . $mode;
} else {
    $handled = "handled:" . $mode;
}

print "mode=$mode\n";
print "access=$access\n";
print "$handled\n";
use strict;
use warnings;

my $mode = ;
my $access = "ok";
my $handled = "";

if ($mode eq "refresh") {
    $handled = "cache:" . $mode;
} elsif ($mode eq "archive") {
    $access = "review";
    $handled = "queue:" . $mode;
} else {
    $handled = "handled:" . $mode;
}

print "mode=$mode\n";
print "access=$access\n";
print "$handled\n";
use strict;
use warnings;

my $mode = ;
my $access = "ok";
my $handled = "";

if ($mode eq "refresh") {
    $handled = "cache:" . $mode;
} elsif ($mode eq "archive") {
    $access = "review";
    $handled = "queue:" . $mode;
} else {
    $handled = "handled:" . $mode;
}

print "mode=$mode\n";
print "access=$access\n";
print "$handled\n";
dispatcher branch Branch-based dispatch avoids stored code references and keeps Perl replay scalar.