What part of the process isn't working? There's no telling where the error is if a blank output file is the only clue. Put debugging code in ur script so u can see what's going on at each step. Show us the output from below with and without changing the slashes.
Gerardo Carvallo Velasco wrote: >> I should copy a file from winXP (local) to a Linux server. >> When I select the file to be copied from a form it appear with the >> this format: c:\path\file >> in my script I try to change the "\" for "/" using the following >> instruction: >> sub uploadFile{ >> $file = $data{'our_file'}; print "\$file is $file\n"; >> $file =s/\\/\//g; print "\$file is now $file\n"; >> $target = "C:/myfiles/documents/drcarvallo/TargetFile.txt"; >> unlink $target if(-e $target); >> open(FILE,"<$file"); or die "can't open $file for reading\n"; >> open(FILE1, ">>$TargetFile") || &show_error("$filepath: Can't open >> because ($!)."); >> while (<FILE>){ >> $line = $_; >> chomp($line); print "read in line $line\n"; >> flock(FILE1,2) if $UseFlock; >> print FILE1 "$line\n"; >> flock(FILE1,8) if $UseFlock; >> } >> close(FILE1); >> close(FILE); >> return 1; >> } >> >> When conclude the script, copy to selected path a file without data. >> However, if I change the slashes ("\" to "/") the file is made correc. -- REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=-- "...ne cede malis" 00000100 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs