Brož Jiří wrote:
> 1. Your file contains \r\r\n (\015\015\012) sequences. It occurs when a file with
>"\r\n"s is read into Perl script some "binary way" and then written out in a text
>mode. In text mode all "\n" are changed to "\r\n" (and so "\r\n" are changed to
>"\r\r\n")
Not that I saw - it contains \r\n as normal when downloaded via the Perl script
URL he provided.
> 2. The file contains some HTML tags and "tag-like" parts too. The IE forces to parse
>it as HTML then for M$ applications use to think they are ever smarter then you are.
>
> If you want to show *this* file like is *intended* (not like it realy is) you have
>to use something like this:
>
> if (open TXT1,"G:/Dropbox/SMatte/WebRoot/test/bs.txt") {
> $buffer = join '', (<TXT1>);
> $buffer =~ s/<([^>]+)>/<$1>/g; # it converts tags to text
> $buffer =~ s/\r\n/\n/g; # "\r\r\n" are changed back to "\r\n" if the
>file is read in text mode
> print "Content-type: text/html\n\n";
> print "<pre>$buffer</pre>"; # white spaces are preserved
> }
In Windoze, the \r\n is converted to \n on reading and back to \r\n on writing
(assuming you are not in binary mode), so there should be no need for the s/// above.
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs