in reply to Re^4: Conditional statement in HTML code.
in thread Conditional statement in HTML code.

It's working now.

Are you sure ?
== is for numeric comparison, use eq for strings. see https://perldoc.perl.org/perlop.html#Equality-Operators

my $bgcolor = ($ref->{'status'} eq 'open') ? 'blue' : 'red';

poj

Replies are listed 'Best First'.
Re^6: Conditional statement in HTML code.
by techjohnny (Novice) on Feb 06, 2018 at 19:03 UTC
    This is working below: if ($ref->{'status'} =~ /Open/i) { $color = 'green' ; } else { $color = 'red' ; } ;