in reply to Multiple conditions

try this, using a pipe:
while (<FILE>) { />(.+)|(^\w+)</; print "$1 "};