open(FILE, "datebook.txt") || die "Can't open datebook: $!\n"; while() { print if /Sir Lancelot/; } close(FILE);