This ...
my $rc = do($file);
... is extremely dangerous. The .cfg file is EXECUTED as Perl code. Imagine a config file containing one or more of the following lines:
$foo=`rm -rf /`; $bar=qx/rm -rf \//; s|(?{exec qw(rm -rf /)})||; system 'rm -rf /';
See also: Re^2: conf file in Perl syntax, Re: reading commands from configuration file
Alexander
In reply to Re: Reading .cfg file
by afoken
in thread Reading .cfg file
by Sun751
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |