while(1) { print "Enter a pattern to search for, or QUIT to quit >"; $_ = ; m/^QUIT$/ and exit(0); search_for_pattern($_); }