#!/iusr/bin/perl open(FH, $ARGV[0]) || die("Cannot Open:$!"); while(){ $char = '-'; $offset = 0; $result = index($_, $char, $offset); while ($result != -1) { print "Found $char at $result\n"; $offset = $result + 1; $result = index($string, $char, $offset); } }