]> git.donarmstrong.com Git - perltidy.git/commitdiff
improved hash-bang warning filter
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 14 Sep 2020 02:05:32 +0000 (19:05 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 14 Sep 2020 02:05:32 +0000 (19:05 -0700)
lib/Perl/Tidy/Tokenizer.pm

index 99dd2619a254a6c306b2127714b76a8e9980c801..c48abc1437bea4a5be777ac5a790c2f21ed0dbed 100644 (file)
@@ -824,9 +824,9 @@ sub get_line {
                 )
                 && !$tokenizer_self->[_look_for_hash_bang_]
 
-                # Patch: be sure there is a slash after the #! before giving a
-                # warning
-                && $input_line =~ /^\#\!\s*\/.*perl\b/
+               # Patch: be sure there is either a slash or the word 'perl'
+               # after the #! before giving a warning.
+                && $input_line =~ /^\#\!\s*(\/|perl)/ 
               )
             {