From: Niall (niall at domain mailtest.inpho.ie)
Date: Fri 11 Feb 2000 - 21:52:55 GMT
On Fri, 11 Feb 2000, Lee Hosty wrote:
> what I'm doing is sucking in a webpage using LWP off a site thats run on a
> mac ...
> I dump this to a file ... then I open this file and want to seperate the
> lines in it ... the at domain array seems to read it in as one element ... so
> chomp() wont work and the only way I can think of to seperate it is by
> splitting it up using the newline element ... \n doesnt work, nor \r\n ...
> I've tried a few combinations of \f \n and \r but still no joy ...
DOS/'doze line endings \r\n
Unix line endings \n
Mac line endings \r
The above are all conventions for text files, but are not absolutes i.e.
there's no reason why you couldn't write a Mac app. which used Unix line
endings (apart from the fact that it would be silly :-) )
As to your web page, the fact that a Mac is serving it doesn't mean that
the pages will have Mac line endings. In fact, they may have no line
endings at all - they're not required for legal HTML, and that seems to be
the case with this file. It's easy to check - get the file and examine it
with some suitable tool like gitview or Emacs hexl-mode (read it and weep,
Kevin and all you other vi weenies :-) ) to see if the file actually is
split into lines.
Niall O Broin
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:05:24 GMT