Skip to content
Snippets Groups Projects
Commit 7341b03b authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Added default value option for template items

parent 3cc7f458
No related branches found
No related tags found
No related merge requests found
......@@ -52,10 +52,13 @@ sub templateReplace
# Grab value
my $itemVal = $hashref->{$section}->{$item};
# Replace in string
$string =~ s/\%{$section\.$item}/$itemVal/gi;
$string =~ s/\%{$section\.$item(=[^}]+)?}/$itemVal/gi;
}
}
# Replace blanks
$string =~ s/\%{[a-z]+\.[a-z0-9\-]+(?:=([^}]+))?}/$1/gi;
return $string;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment