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 @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 (@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 oscail.com
oscail.com 28 Mary Street, Limerick
T: 061 430699 F: 061 430699 W: http://www.oscail.com
mobile 353 (0)86 8768780
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!