Re: [ILUG] [ot] Perl question

From: Lee Hosty (hostyle at domain imail.oscail.com)
Date: Fri 11 Feb 2000 - 17:14:04 GMT


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:
>You could chomp() each line which removes the carriage return, and then
>add it as you're printing it later.
>
>Donncha.
>
>
>Lee Hosty wrote:
>>
>> just a quickie on Perl ...
>>
>> I've just read a file into an array ... how do I change the default newline
>> delimiter when I want to use foreach $line ( at domain array) ??
>>
>> I've tried changing $: and $^L but neither seemed to have any effect ...
>> plus the default for $: is " \n-" which seems a bit confusing to me ... why
>> teh space and - sign ??
>>
>> also ... anyone have any idea what the newline / nextline delimiter is for
>> a MAC ... I've been esarching all day for one ...
>>

Lee Hosty Web Administrator hostyle at domain oscail.com
oscail.com 28 Mary Street, Limerick
T: 061 430699 F: 061 430699 W: http://www.oscail.com

               mobile 353 (0)86 8768780



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:05:24 GMT