[tpm] Irritation problem
Chris Jones
cj at enersave.ca
Wed Apr 4 21:58:16 PDT 2012
Activestate Perl
Window 7
web application using cgi
I use a tab delineated config file that is read into a hash:
infilename ../input
outfilename ../output
Plus a bunch other stuff.
I read it:
#Read the config file
open INFILE, "../input/config1.dat" or die "config1.dat not found\n";
my ($key, $value);
my %confighash;
while( <INFILE> ) {
s/#.*//; # ignore comments by erasing them
next if /^(\s)*$/; # skip blank lines
chomp; # remove trailing newline characters
($key, $value)=split("\t",$_);
$confighash{ $key } = $value;
}
close INFILE;
Further I use:
my $infilename = $confighash{infilename};
my $d2cfilename = $infilename.".dbs";
open INFILE, "$d2cfilename" or &Error_Exit("$d2cfilename not found: $!");
my @d2clines = <INFILE>;
close(INFILE);
Works fine.
But:
my $outfilename = $confighash{outfilename};
my $modfilename = $outfiilename . ".mod"; #add the extension.
open(OUTFILE, ">$modfilename") or &Error_Exit("$modfilename not opened: $!");
Produces an:
"Insecure dependency in open while running with -T switch at
/cgi-bin/my_script.cgi line 1371
Where as:my $outfilename = "hardcode_the_path/filename";
my $modfilename = $outfiilename . ".mod"; #add the extension
open(OUTFILE, ">$modfilename") or &Error_Exit("$modfilename not opened: $!");
Does not product an error.
I am stuck with this one.
Thanks for any help!
>>
Christopher Jones, P.Eng.
Suite 1801, 1 Yonge Street
Toronto, ON M5E1W7
Tel. 416-203-7465
Fax. 416-946-1005
email cj at enersave.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20120405/44d249cb/attachment.html>
More information about the toronto-pm
mailing list