Leser: 1
![]() |
![]() |
7 Einträge, 1 Seite |
1
2
3
4
5
6
7
if (-e path/MyController.pm) {
use MyController;
} else {
use DefController;
}
my $cont = new MyController || newDefController;
1
2
3
4
5
my $class = "DefController";
if (eval "use MyController") {
$class = "MyController";
}
my $cont = $class->new;
1
2
3
4
5
my $class = do {
eval "use MyController";
$@ ? "DefController" : "MyController";
};
my $cont = $class->new();
1
2
3
4
5
6
if ($class eq 'MyController') {
$cont->somethingEnhanced();
}
else {
$cont->basicStuff1(); $cont->basicStuff2(); ...
}
![]() |
![]() |
7 Einträge, 1 Seite |