about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-06-13 23:57:15 +0530
committerAndinus <andinus@nand.sh>2020-06-13 23:57:15 +0530
commitc676fa5cf68a12840591654f364038120591573c (patch)
tree60d0635462de57d583f7580c446d956f2e382cef
parent7f7cf4f7ec52a1d98ca5398c3b382370e82f636a (diff)
downloadara-c676fa5cf68a12840591654f364038120591573c.tar.gz
Shorten "State Unassigned", check for statecode if length > 16
-rwxr-xr-xara.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/ara.pl b/ara.pl
index c7015be..e7e0618 100755
--- a/ara.pl
+++ b/ara.pl
@@ -181,14 +181,22 @@ $rows_to_print = scalar @$statewise
 
 foreach my $i ( 0 ... $rows_to_print - 1  ) {
     my $state = $statewise->[$i]{state};
+
     $state = "India"
         if $state eq "Total";
 
+    $state = "Unassigned"
+        if $state eq "State Unassigned";
+
     next
-        if exists $hide{lc $state};
+        if exists $hide{lc $state}
+        # User sees the statecode if length $state > 16 so we also
+        # match against that.
+        or ( length $state > 16
+             and exists $hide{lc $statewise->[$i]{statecode}});
 
     $state = $statewise->[$i]{statecode}
-        if length($state) > 16;
+        if length $state > 16;
 
     if ( $state_notes ) {
         $notes_table->addRow(