From: Steve Hancock <perltidy@users.sourceforge.net>
Date: Tue, 28 May 2024 01:57:01 +0000 (-0700)
Subject: simplify coding
X-Git-Tag: 20240511.03~7
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=818e82daad13f1c2a5e7fba04bb0b4267b5393bb;p=perltidy.git

simplify coding
---

diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm
index 75798c9a..1ca0a425 100644
--- a/lib/Perl/Tidy.pm
+++ b/lib/Perl/Tidy.pm
@@ -5603,15 +5603,16 @@ sub filter_unknown_options {
     #   $rexpansion = ref to hash with abbreviations as key
     #   $rconfig_file_chatter = messages displayed in --dump-profile
     #
-    # Update: $rconfig_string and $rconfig_file_chatter
+    # Update:
+    #   $rconfig_string and $rconfig_file_chatter
 
     # quick check to skip most files
     if ( ${$rconfig_string} !~ /^\s*---\w/m ) { return }
 
-    my @lines = split /^/, ${$rconfig_string};
     my $new_config_string;
     my $change_notices = EMPTY_STRING;
-    while ( defined( my $line = shift @lines ) ) {
+    my @lines          = split /^/, ${$rconfig_string};
+    foreach my $line (@lines) {
         chomp $line;
 
         # look for lines beginning with '---'