cygwin port
[p5sagit/p5-mst-13.2.git] / utils / perldoc.PL
index 5dd0e1b..7147607 100644 (file)
@@ -56,7 +56,7 @@ Usage: $me [-h] [-r] [-i] [-v] [-t] [-u] [-m] [-n program] [-l] [-F] [-X] PageNa
        $me -q FAQKeywords
 
 The -h option prints more help.  Also try "perldoc perldoc" to get
-aquainted with the system.
+acquainted with the system.
 EOF
 }
 
@@ -559,6 +559,13 @@ if ($opt_q) {
     local @ARGV = @found;      # I'm lazy, sue me.
     my $found = 0;
     my %found_in;
+    my $rx = eval { qr/$opt_q/ };
+    die <<EOD unless $rx;
+Invalid regular expression '$opt_q' given as -q pattern:
+  $@
+Did you mean \\Q$opt_q ?
+
+EOD
 
     while (<>) {
        if (/^=head2\s+.*(?:$opt_q)/oi) {