$work =~ s{%(\w+)(?:\.(\w+))?}{ defined $2 ? $self->{'VARS'}{$1}{$2} : $self->{'VARS'}{default}{$1} }eg;