if (/\b(API|APIN|UWI)\s*\./) { do_something if $1 eq 'API'; do_another if $1 eq 'APIN'; do_else if $1 eq 'UWI'; }