It is used to set the font color of the row values of a table having two columns. None of the rows should be null to set the font color. Left hand side column is set with dark blue color and right hand side column with dark red color.
sub get_colored_differences { my ( $left_side, $right_side) = @_; my @left_side_array = split ( /\^/, $left_side ); my @right_side_array = split ( /\^/, $right_side ); my $left_side_size = scalar ( @left_side_array ); my $right_side_size = scalar ( @right_side_array ); #if ( $left_side_size == $right_side_size ) { if ($left_side_size,$right_side_size>0) { my $idx = 0; for ($idx = 0; $idx < $left_side_size; $idx++) { if ( "$left_side_array[0]" eq "$right_side_array[0]" ) { $left_side_array[$idx] = "" . $left_side_array[$idx] . ""; $right_side_array[$idx] = "" . $right_side_array[$idx] . ""; } } $left_side = join ( '^', @left_side_array ); $right_side = join ( '^', @right_side_array ); } return ( $left_side, $right_side ); }