in reply to Downloading file

My guess from your (vague) description is, that somehow the line endings get mushed up in the transfer. The simplest way in your case would be to add

binmode FILE;

in your read_file subroutine, and see if that helps.

Are you sure that your file looks OK on the source side? Are you sure that your download program does not mess with the file as it is written? Windows and Unix have different concepts of "text files", so that might be a problem as well - did you copy the file manually from one machine to another and see if you have the same problems?

Replies are listed 'Best First'.
Re: Re: Downloading file
by Anonymous Monk on Feb 07, 2004 at 11:08 UTC
    don't forget binmode STDOUT!!!
      Hi,
      Thanks for your valuable information.
      The problem is that while writing a file in server, each data stored in an array will write into the file and "\n" is used to separate each line. I think that's why i couldn't get the proper file.
      writing content in a file, i used this code
      open (FL,"+<file.txt") foreach $ans(@arr) { print FL $ans."\n"; } close FL;
      Is there any way to write content line by line without appending "n"
      Waiting for your suggestion
      Thanks, Sur