Remove deprecated given/when calls

This commit is contained in:
Chris 2024-04-29 13:04:29 +01:00
parent 3c1832cf05
commit 826b1e5d94

View File

@ -880,11 +880,9 @@ sub ordinal {
my ($key) = $val =~ /(\d)$/; my ($key) = $val =~ /(\d)$/;
my $ext = "th"; my $ext = "th";
given($key) { if($key eq "1") { $ext = "st"; }
when("1") { $ext = "st"; } if($key eq "2") { $ext = "nd"; }
when("2") { $ext = "nd"; } if($key eq "3") { $ext = "rd"; }
when("3") { $ext = "rd"; }
};
return $val.$ext; return $val.$ext;
} }
@ -1089,11 +1087,10 @@ sub _markdown_underline {
my $title = shift; my $title = shift;
my $type; my $type;
given($level) { if($level eq "#") { $type = "-="; }
when("#") { $type = "-="; } if($level eq "##") { $type = "="; }
when("##") { $type = "="; } if($level eq "###") { $type = "-"; }
when("###") { $type = "-"; }
}
return $title if(!$type); return $title if(!$type);
# Build the underscores - may need additional trimming as 'type' can be multichar # Build the underscores - may need additional trimming as 'type' can be multichar