From: Steve Hancock Date: Sun, 14 Aug 2022 00:36:36 +0000 (-0700) Subject: eliminate nonstandard usages of @_ X-Git-Tag: 20220613.05~51 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=76bec7f7e529124abb18de916cfae70e855455da;p=perltidy.git eliminate nonstandard usages of @_ --- diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index a9d01e32..fc3dd237 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -1863,25 +1863,25 @@ EOM ); my %is_for_foreach; - @_ = qw(for foreach); - @is_for_foreach{@_} = (1) x scalar(@_); + @q = qw(for foreach); + @is_for_foreach{@q} = (1) x scalar(@q); my %is_my_our_state; - @_ = qw(my our state); - @is_my_our_state{@_} = (1) x scalar(@_); + @q = qw(my our state); + @is_my_our_state{@q} = (1) x scalar(@q); # These keywords may introduce blocks after parenthesized expressions, # in the form: # keyword ( .... ) { BLOCK } # patch for SWITCH/CASE: added 'switch' 'case' 'given' 'when' my %is_blocktype_with_paren; - @_ = + @q = qw(if elsif unless while until for foreach switch case given when catch); - @is_blocktype_with_paren{@_} = (1) x scalar(@_); + @is_blocktype_with_paren{@q} = (1) x scalar(@q); my %is_case_default; - @_ = qw(case default); - @is_case_default{@_} = (1) x scalar(@_); + @q = qw(case default); + @is_case_default{@q} = (1) x scalar(@q); #------------------------ # end of tokenizer hashes diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 1ea97ad2..fb9cb7da 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -1310,8 +1310,8 @@ sub fix_terminal_else { my %is_closing_block_type; BEGIN { - @_ = qw< } ] >; - @is_closing_block_type{@_} = (1) x scalar(@_); + my @q = qw< } ] >; + @is_closing_block_type{@q} = (1) x scalar(@q); } sub check_match {