You can do that in a very light weight way by creating a package for each feed type. They can be in a single file or multiple files or even the main file. If not in the main file you can use or require as suits your purpose then create an instance of the appropriate type. Consider:
use strict;
use warnings;
package FetchOne;
sub new {
my ($class, %params) = @_;
return bless\%params, $class;
}
sub type {
return 'Fetch type One';
}
package FetchTwo;
sub new {
my ($class, %params) = @_;
return bless\%params, $class;
}
sub type {
return 'Fetch type Two';
}
package main;
my $type = 'Two';
my $obj = "Fetch$type"->new();
print $obj->type();
Prints:
Fetch type Two
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond