about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-06-06 22:56:39 +0530
committerAndinus <andinus@nand.sh>2020-06-06 23:26:30 +0530
commitc65c7ff3d0ee33a137b91e35d4f884831baf9db3 (patch)
treeddee2b99e97f4d828c9e2272931a2ae66add8781
parentd4398b5547e0cd80fe0f57e5e6ca1bf18949bff8 (diff)
downloadara-c65c7ff3d0ee33a137b91e35d4f884831baf9db3.tar.gz
Use foreach instead of each
-rwxr-xr-xara.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/ara.pl b/ara.pl
index 860c528..f522d72 100755
--- a/ara.pl
+++ b/ara.pl
@@ -53,8 +53,10 @@ my %unveil = (
 
 # Unveil each path from %unveil.
 keys %unveil;
-while( my( $path, $permission ) = each %unveil ) {
-    unveil( $path, $permission ) or
+
+# We use sort because otherwise keys is random order everytime.
+foreach my $path ( sort keys %unveil ) {
+    unveil( $path, $unveil{$path} ) or
         die "Unable to unveil: $!";
 }
 
@@ -100,7 +102,6 @@ my $json_data = decode_json($file_data);
 # Get statewise information.
 my $statewise = $json_data->{statewise};
 
-
 my ( $covid_19_data, $notes_table, @months, $today );
 
 if ( $state_notes ) {