D
Daniel Parry
Hello all,
I was wondering if anyone could give me some pointers as to the
best way to untaint the assocative array %config in the following
snippet please? Do I need to check its content against a suitable
regexp somehow? Or maybe I should use another method to read in
the file contents, though I'd prefer to not to have to include
any cpan libraries...
no strict;
if ( open( CONFIG, "$configFile" ) ) {
my $readConfig = "";
while ( <CONFIG> ) { $readConfig .= $_; }
eval $readConfig;
%config = %{ $userconfig };
close( CONFIG );
}
else {
die "Could not read config file: $configFile!";
}
use strict;
Thanks in advance for any help!
Best wishes,
Daniel
I was wondering if anyone could give me some pointers as to the
best way to untaint the assocative array %config in the following
snippet please? Do I need to check its content against a suitable
regexp somehow? Or maybe I should use another method to read in
the file contents, though I'd prefer to not to have to include
any cpan libraries...
no strict;
if ( open( CONFIG, "$configFile" ) ) {
my $readConfig = "";
while ( <CONFIG> ) { $readConfig .= $_; }
eval $readConfig;
%config = %{ $userconfig };
close( CONFIG );
}
else {
die "Could not read config file: $configFile!";
}
use strict;
Thanks in advance for any help!
Best wishes,
Daniel