Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Clarified "require <>"-message #13624

Closed
p5pRT opened this issue Feb 26, 2014 · 8 comments
Closed

[PATCH] Clarified "require <>"-message #13624

p5pRT opened this issue Feb 26, 2014 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 26, 2014

Migrated from rt.perl.org#121331 (status was 'resolved')

Searchable as RT121331$

@p5pRT
Copy link
Author

p5pRT commented Feb 26, 2014

From @rjbs

I wanted to get this into RT for likely application early in the 5.21 series.

----- Forwarded message from Norman Koch <kochnorman@​rocketmail.com> -----

Date​: Sat, 4 May 2013 23​:18​:31 +0200
From​: Norman Koch <kochnorman@​rocketmail.com>
To​: perl5-porters@​perl.org
Subject​: [PATCH] Clearified "require <>"-Message
List-Id​: <perl5-porters.perl.org>

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(-)

Inline Patch
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

----- End forwarded message -----

--
rjbs

@p5pRT
Copy link
Author

p5pRT commented May 19, 2014

From @jkeenan

I've taken the inline patch and put it in an attachment that I think can be applied with 'git am' once we're ready to do so.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented May 19, 2014

From @jkeenan

121331_require_warning.diff
Date: Sat,  4 May 2013 23:18:31 +0200
From: Norman Koch <kochnorman@rocketmail.com>
To: perl5-porters@perl.org
Subject: [PATCH] Clarified "require <>"-message
List-Id: <perl5-porters.perl.org>

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

@p5pRT
Copy link
Author

p5pRT commented May 19, 2014

From @jkeenan

On Mon May 19 15​:53​:56 2014, jkeenan wrote​:

I've taken the inline patch and put it in an attachment that I think
can be applied with 'git am' once we're ready to do so.

Thank you very much.
Jim Keenan

Correction! In order to welcome Norman Koch to membership in the AUTHORS of Perl 5, we'll have to update the AUTHORS file as well.

Please only use the "2nd" patch.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented May 19, 2014

From @jkeenan

121331_2nd_require_warning.diff
diff --git a/AUTHORS b/AUTHORS
index 2fb096e..d06e141 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -873,6 +873,7 @@ Nobuhiro Iwamatsu
 Noirin Shirley			<colmsbook@nerdchic.net>
 Norbert Pueschel		<pueschel@imsdd.meb.uni-bonn.de>
 Norio Suzuki			<kipp@shonanblue.ne.jp>
+Norman Koch			<kochnorman@rocketmail.com>
 Norton T. Allen			<allen@huarp.harvard.edu>
 Nuno Carvalho			<mestre.smash@gmail.com>
 Offer Kaye			<offer.kaye@gmail.com>
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index f87ca9c..aad0bb6 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -5017,7 +5017,7 @@ take the risk of using this feature, simply disable this warning:
 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 ec7a122..a152d2d 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 ea88183..178b1ee 100644
--- a/toke.c
+++ b/toke.c
@@ -8484,7 +8484,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;

@p5pRT
Copy link
Author

p5pRT commented May 19, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 31, 2014

From @jkeenan

On Mon May 19 16​:05​:42 2014, jkeenan wrote​:

Correction! In order to welcome Norman Koch to membership in the
AUTHORS of Perl 5, we'll have to update the AUTHORS file as well.

Please only use the "2nd" patch.

Committed to blead in commit 808cb9e.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented May 31, 2014

@jkeenan - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant