open(FILE,"perlmonks.txt") or die $!; while(){ if(/^\s(\w)\s+(\w)/){ print "$1 ::: $2\n"; } }