From: Fergal Daly (fergal at domain esatclear.ie)
Date: Fri 11 Feb 2000 - 17:25:47 GMT
I think \r is the newline sep for a mac. The variable you want to play with
is $/, if you do
$/ = "\r";
open(FILE, "filename");
at domain array = <FILE>;
then perl will split the contents of the file on occurences of \r.
By the way if the page is big you should use
while (<FILE>)
{
do some stuff with $_
}
instead of using at domain array as at domain array will read the whole thing in before doing
anything else, the same goes for for loops.
Also, why do you download the page, dump it in a file and then open that
file? Why not download the page and just do
at domain array = split("\r", $the_web_page);
Fergal
At 17:14 11/02/00 +0000, 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 ...
>
>At 16:44 11/02/00 +0000, Donncha O Caoimh wrote:
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:05:24 GMT