
while (<>) {
  if ($_ =~ /foo/) {
    print "That matches.\n";
  }
}

