#!/usr/local/bin/perl # Jaime Prilusky, 2003 my $string = $ARGV[0] || "Yet another simple and anomalous annotation"; print "Search for? "; my $target = ; chomp($target); my($position); do { $foundAt = index($string,$target,$position); print "found $foundAt\n"; $position = $foundAt + 1; } until ($foundAt < 0);