You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you return immediately after a whitespace-stripping here-doc, perlcritic warns about Subroutines::RequireFinalReturn, '[...] does not end with "return".'
Test module :
package Test;
use warnings;
use strict;
sub test {
my $str = <<~'HEREDOC';
some text
HEREDOC
return $str;
}
1;
Test.pm: (Severity 4) Line 5: Subroutine "test" does not end with "return"
Doesn't seem to matter what you return.
Putting any code between the closing HEREDOC and the return causes issue to not occur.
Even (incorrectly) putting a semicolon after the closing HEREDOC appeases perlcritic, while also not compiling.
I would expect perlcritic to not complain.
Using Perl 5.26.1 and perlcritic 1.130.
The text was updated successfully, but these errors were encountered:
They seem to be supported now and when updating both PPI and Critic to newest (1.270 and 1.134), fixed Critic complaining about things when it shouldn't (in my case it was the last sub in a module and it complained about the module not ending with 1; — but I tried to replicate OP's situation and it passed also).
Not sure if bug.
If you return immediately after a whitespace-stripping here-doc, perlcritic warns about Subroutines::RequireFinalReturn, '[...] does not end with "return".'
Test module :
Doesn't seem to matter what you return.
Putting any code between the closing HEREDOC and the return causes issue to not occur.
Even (incorrectly) putting a semicolon after the closing HEREDOC appeases perlcritic, while also not compiling.
I would expect perlcritic to not complain.
Using Perl 5.26.1 and perlcritic 1.130.
The text was updated successfully, but these errors were encountered: