NAME

String::Interpolate::RE - interpolate variables into strings using regular expressions

VERSION

version 0.11

SYNOPSIS

# default formulation
use String::Interpolate::RE qw( strinterp );

$str = strinterp( "${Var1} $Var2", $vars, \%opts );

# import with different default options.
use String::Interpolate::RE strinterp => { opts => { useENV => 0 } };

DESCRIPTION

This module interpolates variables into strings using regular expression matching rather than Perl's built-in interpolation mechanism and thus hopefully does not suffer from the security problems inherent in using eval to interpolate into strings of suspect ancestry.

Changing the default option values

The default values for "strinterp"'s options were not all well thought out. String::Interpolate::RE uses Exporter::Tiny, allowing a version of "strinterp" with saner defaults to be exported. Simply specify them when importing:

use String::Interpolate::RE strinterp => { opts => { useENV => 0 } };

The subroutine may be renamed using the -as option:

use String::Interpolate::RE strinterp => { -as => strinterp_noenv,
                                           opts => { useENV => 0 } };

strinterp_noenv( ... );

INTERFACE

DIAGNOSTICS

BUGS AND LIMITATIONS

You can make new bug reports, and view existing ones, through the web interface at https://rt.cpan.org/Public/Dist/Display.html?Name=String-Interpolate-RE.

AUTHOR

Diab Jerius djerius@cpan.org

COPYRIGHT AND LICENSE

This software is Copyright (c) 2017 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007