#!/usr/bin/perl -w use strict; open(WORDS, "){ if(!/b.*b/ && !/a.*a.*a/ && !/k.*k/ ){ push(@_, $_); } } close(WORDS); print @_,; exit;