From: Steve Hancock Date: Sun, 7 Apr 2024 04:38:44 +0000 (-0700) Subject: eliminate last uses of each builtin X-Git-Tag: 20240202.05~14 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2efc40462eb58bd7a12e4bcfd087758285d38f96;p=perltidy.git eliminate last uses of each builtin --- diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index 5c218978..695b340c 100644 --- a/lib/Perl/Tidy/HtmlWriter.pm +++ b/lib/Perl/Tidy/HtmlWriter.pm @@ -476,7 +476,8 @@ sub make_abbreviated_names { my ( $class, $rexpansion ) = @_; # abbreviations for color/bold/italic properties - while ( my ( $short_name, $long_name ) = each %short_to_long_names ) { + foreach my $short_name ( keys %short_to_long_names ) { + my $long_name = $short_to_long_names{$short_name}; ${$rexpansion}{"hc$short_name"} = ["html-color-$long_name"]; ${$rexpansion}{"hb$short_name"} = ["html-bold-$long_name"]; ${$rexpansion}{"hi$short_name"} = ["html-italic-$long_name"]; @@ -548,7 +549,8 @@ sub check_options { # setup property lookup tables for tokens based on their short names # every token type has a short name, and will use these tables # to do the html markup - while ( my ( $short_name, $long_name ) = each %short_to_long_names ) { + foreach my $short_name ( keys %short_to_long_names ) { + my $long_name = $short_to_long_names{$short_name}; $html_color{$short_name} = $rOpts->{"html-color-$long_name"}; $html_bold{$short_name} = $rOpts->{"html-bold-$long_name"}; $html_italic{$short_name} = $rOpts->{"html-italic-$long_name"};