Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 540 forks source link

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

Closed p5pRT closed 10 years ago

p5pRT commented 10 years ago

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

Searchable as RT121331$

p5pRT commented 10 years ago

From @rjbs

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

----- Forwarded message from Norman Koch \kochnorman@&#8203;rocketmail\.com -----

Date​: Sat\, 4 May 2013 23​:18​:31 +0200 From​: Norman Koch \kochnorman@&#8203;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 \"\, 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 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. 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 >> when you should have written C. 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 '; -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 commented 10 years ago

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 commented 10 years ago

From @jkeenan

121331_require_warning.diff ```diff Date: Sat, 4 May 2013 23:18:31 +0200 From: Norman Koch To: perl5-porters@perl.org Subject: [PATCH] Clarified "require <>"-message List-Id: Changed "<> should be quotes" to "<> at require-statement should be quotes" when someone writes "require ", 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. 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 >> when you should have written C. 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 '; -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 commented 10 years ago

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 commented 10 years ago

From @jkeenan

121331_2nd_require_warning.diff ```diff diff --git a/AUTHORS b/AUTHORS index 2fb096e..d06e141 100644 --- a/AUTHORS +++ b/AUTHORS @@ -873,6 +873,7 @@ Nobuhiro Iwamatsu Noirin Shirley Norbert Pueschel Norio Suzuki +Norman Koch Norton T. Allen Nuno Carvalho Offer Kaye 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 >> when you should have written C. 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 '; -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 commented 10 years ago

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

p5pRT commented 10 years ago

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 808cb9e98625e89abe4e21e243670aa46c12c5d3.

Thank you very much. Jim Keenan

p5pRT commented 10 years ago

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