Module-Generic
view release on metacpan or search on metacpan
lib/Module/Generic.pm view on Meta::CPAN
# Only allow characters that make sense for hash-like parameters.
# This forbids variables, code blocks, Perl ops, backticks, etc.
if( $params =~ /[^a-zA-Z0-9_,\=>\s\h[:blank:]'"\|\(\)\.\-]/ )
{
$self->__message( 120, "\$process_params->(): Illegal characters found inside eval." );
return;
}
# illegal functions that have no business being here, and could pass through the previous check
elsif( $params =~ /\b(?:
qx|system|open|exec|fork|require|use|eval|do|
package|sub|BEGIN|UNITCHECK|CHECK|INIT|END|
readpipe|sysopen|unlink|rename|chmod|chown|utime|truncate|mkdir|rmdir|opendir|readdir|closedir|glob
)\b/i )
{
$self->__message( 120, "\$process_params->(): Illegal functions used inside eval." );
return;
}
local $SIG{__WARN__} = sub{};
local $SIG{__DIE__} = sub{};
local $@;
( run in 0.621 second using v1.01-cache-2.11-cpan-39bf76dae61 )