in reply to regex question
I Think you need if ( !/$words/ ) {...} rather than if ( $_ !~ /$words/ ) {...}
UpdateYep! I completely misread that one:(