in reply to Force Ascii Write

It's a little difficult for me to determine without examples of the observed and expected output, but how about

open BIDWATCH, ">:utf8", "/home/autotasks/pricemonitor/Google";

Replies are listed 'Best First'.
Re^2: Force Ascii Write
by Kzin (Acolyte) on Apr 05, 2006 at 19:18 UTC
    Thanks for your quick reply! Here is my expected output etc. Examples:
    ...What is happening... Client Machine (before script); kzin@IT-001:~$ file Google Google: ASCII text kzin@IT-001:~$ file overture.txt overture.txt: ASCII text
    Server (after script); autotasks@mail:~/pricemonitor$ file Google Google: data autotasks@mail:~/bidWatch$ file overture.txt overture.txt: ASCII text
    Note that the perl script has not written ASCII text.
    ...Expected output... autotasks@mail:~/pricemonitor$ file Google Google: ASCII text autotasks@mail:~/bidWatch$ file overture.txt overture.txt: ASCII text
    I tried the method that you posted, same problem. Note both files start as ASCII text, then they are emailed (separatley) to the server. Procmail sends them to this program. This program is the one that does the writing. Note that the MIME header is text/plain for both files.

    By Kzin
      Do you really care about the output of file, or do you think the contents of the file are bad? The best way to answer either/both questions is by having a look at the file Google. Please show us (at least a sample of) the file Google (perhaps using od) when file Google returns "Data".
        Right on, thanks for the reply. I will show you what I can of the file... I can't give you the full thing, though (Work disallows that).
        Ok, to write it out first, without the octal, editing the file on the client end with vi I can see the text is formatted properly. When I edit the "Data" file on the server, every once in a while there is a line broken with a blue ^@. I dont actually know what this means.
        od output; first 3 lines
        0000000 020101 020061 060504 020171 061501 073165 062565 021440 0000020 021443 072150 070164 027472 073457 073567 061456 060557 0000040 072163 066141 067543 072156 061541 071564 061456 066557
        vi; a sample of a random line in VI before 4-%20I%20cases&ProdID=202&Dispgroup=1&CatID=20###4.5 vi; a sample of the same line in VI after 4-%20I                   ^@ases&ProdID=202&Dispgroup=1&CatID=20###4.5 Interesting, it seems to have translated the 0c of the ascii term to a ^@. There is another line in the file that had 0c and it got changed to the same.
        There are some spots in the file that have gotten big spaces put into them somehow.
        So it does in fact seem that the file is getting moderately mangled. I am still able to read the file, just those minor errors in it. Do you think I would first have to write a manual header line to the top of the file? If so, how do you do that?
        Thanks again for the reply =)

        By Kzin