Patricia Hinman wrote: > > I'm writing a CGI script that allows a user to create > directories and upload an html file. I'm using this > at the beginning of the script > > #!C:\Perl\bin\perl.exe -w -T > #!/usr/bin/perl > use strict; > BEGIN{open(STDERR, ">./err.txt");} > > the htmldir is read from a txt file and > untainted like this: > > $htmldir =~ s@[^\w\-\\]@@g; > > #and using find.pm in this manner: > > sub allsubdir{ > my$k=0; > my$root = "$ENV{'DOCUMENT_ROOT'}/$htmldir/"; > find (\&do_this, $root); > > sub do_this { > $_ = $File::Find::dir; > unless(/\.\w*$/){push(@subdir1,$_);} > } > return @subdir; > } > > This is the only error I get. > > Insecure dependency in chdir while running with -T > switch at C:/Perl/lib/File/Find.pm line 765, <DIRINFO> > line 2. > > How do I fix this? I've downloaded the Safe module > but I'm not sure how to use it yet.
Try running File::Find with the no_chdir option. find( { wanted => \&do_this, no_chdir => 1 }, $root ); John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]