From: Steve Hancock Date: Sun, 13 Sep 2020 14:38:14 +0000 (-0700) Subject: prevent unnecessary hash-bang warning message X-Git-Tag: 20200907.01~12 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4f7733e401e2e9d8f95382c6e4b6794919db645c;p=perltidy.git prevent unnecessary hash-bang warning message --- diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 894156b5..f2a92e56 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -814,7 +814,7 @@ sub get_line { } if ( - ( $input_line_number > 1 ) + $input_line_number > 1 # leave any hash bang in a BEGIN block alone # i.e. see 'debugger-duck_type.t' @@ -822,7 +822,11 @@ sub get_line { $last_nonblank_block_type && $last_nonblank_block_type eq 'BEGIN' ) - && ( !$tokenizer_self->[_look_for_hash_bang_] ) + && !$tokenizer_self->[_look_for_hash_bang_] + + # Patch: be sure there is a slash after the #! before giving a + # warning + && $input_line =~ /^\#\!\s*\/.*perl\b/ ) {