develooper Front page | perl.perl5.porters | Postings from May 2013

[PATCH] Clearified "require <>"-Message

From:
Norman Koch
Date:
May 6, 2013 18:33
Subject:
[PATCH] Clearified "require <>"-Message
Message ID:
1367702311-24676-1-git-send-email-kochnorman@rocketmail.com
Changed "<> should be quotes" to
"<> at require-statement should be quotes" when someone
writes "require <Module>", because this way it is way
easier to find the specific command that caused this.
---
 pod/perldiag.pod      |    2 +-
 t/op/require_errors.t |    2 +-
 toke.c                |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 3d8212e..81c36be 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -4716,7 +4716,7 @@ L<perlfunc/setsockopt>.
 interpreted as the != (numeric not equal) and ~ (1's complement)
 operators: probably not what you intended.
 
-=item <> should be quotes
+=item <> at require-statement should be quotes
 
 (F) You wrote C<< require <file> >> when you should have written
 C<require 'file'>.
diff --git a/t/op/require_errors.t b/t/op/require_errors.t
index e323948..56bacf6 100644
--- a/t/op/require_errors.t
+++ b/t/op/require_errors.t
@@ -55,7 +55,7 @@ for my $file ("$nonfile.ph", ".ph") {
 }
 
 eval 'require <foom>';
-like $@, qr/^<> should be quotes at /, 'require <> error';
+like $@, qr/^<> at require-statement should be quotes at /, 'require <> error';
 
 my $module   = tempfile();
 my $mod_file = "$module.pm";
diff --git a/toke.c b/toke.c
index 08e9c4d..7d29074 100644
--- a/toke.c
+++ b/toke.c
@@ -8287,7 +8287,7 @@ Perl_yylex(pTHX)
 		    gv_stashpvn(PL_tokenbuf, strlen(PL_tokenbuf),
                                 GV_ADD | (UTF ? SVf_UTF8 : 0));
 		else if (*s == '<')
-		    yyerror("<> should be quotes");
+		    yyerror("<> at require-statement should be quotes");
 	    }
 	    if (orig_keyword == KEY_require) {
 		orig_keyword = 0;
-- 
1.7.10.4




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About