This is a test-thingy from tester okay #### The word repeated in Line 1 and in column #### my $word="test"; while() { my $occurs; @arr = split(/\s+/,$_); $col = ""; $i=0; foreach $k (@arr) { if($k eq "$word") { $col.=($i+1)."\t"; $occurs = 1; } $i++; } if ($occurs) { print "The word repeated in Line ".$.." and in column ".$col."\n"; } } __DATA__ This is a test-thingy from tester okay nothing message test center test test in proress ... test one test two