use warnings; use strict; while () { if (/[A-Z]/) { print 'good '; } else { print 'bad '; } print; } __DATA__ * *,* *.* ABC ABC,DEF,GHI_JKL