This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25ea24b
)
more meaningful message on invalid pattern argument (from
author
Gurusamy Sarathy
<gsar@cpan.org>
Wed, 2 Feb 2000 06:03:04 +0000
(06:03 +0000)
committer
Gurusamy Sarathy
<gsar@cpan.org>
Wed, 2 Feb 2000 06:03:04 +0000
(06:03 +0000)
Kevin Meltzer <KMeltzer@USCO.com>)
p4raw-id: //depot/perl@4945
utils/perldoc.PL
patch
|
blob
|
blame
|
history
diff --git
a/utils/perldoc.PL
b/utils/perldoc.PL
index
5dd0e1b
..
c4a9113
100644
(file)
--- a/
utils/perldoc.PL
+++ b/
utils/perldoc.PL
@@
-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) {