in reply to Re: Insecure dependency in open while running with -T switch
in thread Insecure dependency in open while running with -T switch
Either you expect the code that uses in the file handle in the if (causing the error message to be far away from the error check), or you just created a file handle that gets closed before you get a chance to use it. Slight reorganization of your code:
if ( $outfile !~ m{\A(\w+)\z} ) { die qq{Disallowed characters in filename\n}; } $outfile = $1; open my $outFH, q{>}, $outfile or dir qq{open: $outfile: $!\n};
|
|---|