use Output::Console; use Output::Tk; my $output_strategy = -T STDOUT ? 'Output::Console' : 'Output::Tk'; my $output = $output_strategy->new();