my @parts = split /::/, $component;
for (@parts) {
- return 'controller' if /c|controller/i;
- return 'model' if /m|model/i;
- return 'view' if /v|view/i;
+ return 'controller' if /^c|controller$/i;
+ return 'model' if /^m|model$/i;
+ return 'view' if /^v|view$/i;
}
}