more useful options | |
PerlMonks |
Re: Taint problem opening file to writeby Necos (Friar) |
on Apr 30, 2002 at 12:41 UTC ( [id://163041]=note: print w/replies, xml ) | Need Help?? |
From what I gather, your tainting is not from the filename (because you SEEM to have untainted it). However, you should be very wary of this: open(FILE,">$file"); vs. open(FILE,"> $file"); The first one (if untainted properly), will make sure there are no leading spaces in the filename. The second, may or may not work how you suspect, and just MIGHT be the cause of the problem. I don't think I've read any book that uses open(F,"> $file");. Looking at your code a third time, I noticed that you don't bother to look for leading or trailing spaces (regex \s) in $file_out. So, let's just eliminate part of that problem with a: $file_out =~ s/\s+//;. Hope that helps some... Theodore Charles III Network Administrator Los Angeles Senior High 4650 W. Olympic Blvd. Los Angeles, CA 90019 323-937-3210 ext. 224 email->secon_kun@hotmail.com perl -e "map{print++$_}split//,Mdbnr;"
In Section
Seekers of Perl Wisdom
|
|