try putting:

binmode HTML, ":text";

immediately after the open.

On Mon, 22 Oct 2001, dan.kelley wrote:

>
> hi-
>
> i'm tring to write a simple script that opens a set of html files and
> replaces one hunk of text with another.  i'm using 5.6.0 on solaris 8.
> the script runs fine, and correctly replaces every piece of text that it
> should.  problem is this:  it seems to convert the mode of the file in a
> way that renders it unreadable to an application that's used to opening
> ascii files.
>
> here's a synopsis of how i'm doing my edit:
>
> $file = "test.html"
> print "opening $file.\n";
> open(*HTML, "+> $file");
> truncate *HTML, 0;
> print *HTML "testing file type conversion\n";
> close(*HTML);
>
> before running my script on the specified file, file reports a type of
> ascii text:
>
> % file accepted-candidates.html
> test.html:       ascii text
>
> after running my script, here's what i'm seeing:
>
> % file accepted-candidates.html
> test.html:       English text
>
> i'm guessing that my file is now UTF-8 encoded - how do i force perl to
> output a vanilla ascii file?
>
> thanks-
>
> dan
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to