On Mon, 1 Sep 2003, Jason wrote:

> >The problem here is you have to define a "line".  A line of email can have
> >up to 1000 (I think) characters.  Postfix will split the line at 990
> >characters by default.  And then there's all the extra information added
> >by using HTML.
>
> All the extra HTML information is removed by the script already - except for
> the stylesheet
> information in certain situations due to the bug. To be more specific about my
> question
> above, what I want to do is:
>
> @sometext = ("text\n\with\nmore\nthan\none\nnewline\n",
> "some\nother\nline\n");
> @newtext = ("text\n", "with\n", "more\n", "than\n", "one\n", "newline\n",
> "some\n",
> "other\n", "line\n");
> #Do something magic to @sometext here to make it turn into @newtext
>
>
> Probably have to write a routine to do searches of \n to make a new array and
> then
> replace the old one with it, right? I was thinking that it would be a little
> slow like that,
> however, and was wondering if there was some better way.

Just two things:
1) perldoc -f split
2) man perlfunc

Perl typically excels at text processing.  You can also look at the
'join' command if you wish.  But certainly 'man perlfunc' along with
'perldoc -f $function_name' will let you go far with your scripts.  :)

Another option would be to use the 's' operator (man perlop)  to change
all newlines to spaces.
eg: $sometext =~ s/\n/ /g
You'd probably want to add a newline to end if you do this.

-- 
Marshal Newrock, unemployed Linux user in Lansing, MI
Caution: Product will be hot after heating


--
[EMAIL PROTECTED] mailing list

Reply via email to