develooper Front page | perl.libwww | Postings from August 2003

Beginning of line whitespace removal

Thread Next
August 2, 2003 10:15
Beginning of line whitespace removal
Message ID:
Until recently, I've not even noticed that data I get back from
libwww/UserAgent/simple_request has all beginning whitespace stripped from lines.
At first I thought it was the default behavior when getting content returned
when using the LWP::UserAgent/simple_request classes.

But I stepped into a simple_request call far enough to see that the data returned
from sysread() also has whitespace removed at the beginnings of lines.  This is
different from the the webpage, which has indented HTML code.  The only reason I
care is I'm trying to extract text within <pre> blocks without losing whitespace.

Any suggestions on how to preserve the HTML data?  If it weren't for requiring cookies,
a log in, and complicated redirects I'd search out another solution.  I'm surprised
at the sysread() return value and would think that's as raw as the data can get.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About