use strict; print foo("abcCj"); sub foo { return ($_[0] =~ /TC/g) ? "TC" : "26 "; }