M
Mark J Fenbers
Consider this stripped-down Perl script:
#!/usr/bin/perl -w -T
use strict;
foreach $file ( <ahps.dat.???> ) {
open(OUT, ">$file.new") or die "message...";
# do stuff;
close OUT;
}
I get a taint dependency error on the "open" statement. The "perlsec" man page
says this is a tainted situation (and I understand why), but it offers little
advice of how to get around it. In the unstripped program, given filenames such
as "ahps.dat.cle", I want to read in data from the file, modify the data, and
write the altered data back out to a file called "ahps.dat.cle.new" for human
examination... but it won't let me do this with "-T" unless I hardwire the
output filename (which isn't a reasonable solution).
Any ideas to get around this?
Mark
#!/usr/bin/perl -w -T
use strict;
foreach $file ( <ahps.dat.???> ) {
open(OUT, ">$file.new") or die "message...";
# do stuff;
close OUT;
}
I get a taint dependency error on the "open" statement. The "perlsec" man page
says this is a tainted situation (and I understand why), but it offers little
advice of how to get around it. In the unstripped program, given filenames such
as "ahps.dat.cle", I want to read in data from the file, modify the data, and
write the altered data back out to a file called "ahps.dat.cle.new" for human
examination... but it won't let me do this with "-T" unless I hardwire the
output filename (which isn't a reasonable solution).
Any ideas to get around this?
Mark