NAME

Dpkg::Substvars - handle variable substitution in strings

DESCRIPTION

It provides some an object which is able to substitute variables in strings.

METHODS

my $s = Dpkg::Substvars->new($file)

Create a new object that can do substitutions. By default it contains generic substitutions like ${Newline}, ${Space}, ${Tab}, ${dpkg:Version}, ${dpkg:Upstream-Version} and ${Arch}.

Additional substitutions will be read from the $file passed as parameter.

$s->set($key, $value)

Add/replace a substitution.

$s->get($key)

Get the value of a given substitution.

$s->delete($key)

Remove a given substitution.

$s->parse($file)

Add new substitutions read from $file.

$s->set_version_substvars($version)

Defines ${binary:Version}, ${source:Version} and ${source:Upstream-Version} based on the given version string.

$newstring = $s->substvars($string)

Substitutes variables in $string and return the result in $newstring.

AUTHOR

Raphael Hertzog <hertzog@debian.org>.