#------------------------------------------------------------------------------ =pod =head2 interpolate( scalar, href ) Purpose : To interpolate an href of vars into a string. Usage : my $template = q{$name was also know as $alias.}; my $variables = { '$name' => 'Bob', '$alias' => 'Big Bad Bob', }; interpolate( $template, $variables ); =cut #------------------------------------------------------------------------------ sub interpolate { my ( $text, $variables ) = @_; $text =~ s/$_/$variables->{$_}/g for ( keys %$variables ); return $text; }