Re: [RE: [Re: [SLUG] Need Help With LWP and newlines]]

2003-01-02 Thread Louis Selvon
>There's a whole bunch of design decisions to be made in making a text to
html translator, so you probably want to look around a few different
options to find something that fits your requirements.  Try searching
google for 'perl "text to html"'.

*** I have found what I needed. The Perl module I downloaded is
HTML::TextToHTML.

This problem is now solved. The issue was in fact to format the message in
HTML format from my end before posting to the form.

Thanks everyone for their help on this.

Louis.

--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



RE: [Re: [SLUG] Need Help With LWP and newlines]

2003-01-02 Thread Andrew McNaughton
On Mon, 30 Dec 2002, LS wrote:

> This raises my next question, does LWP has a way to send data
> between text and html format, or this is not even related to
> LWP at all ?
>
> I don't want to have to write something to convert the text
> message in HTML format. There must be some Perl module that
> does this, or something else ?

There's a whole bunch of design decisions to be made in making a text to
html translator, so you probably want to look around a few different
options to find something that fits your requirements.  Try searching
google for 'perl "text to html"'.

> Basically after each paragraph I need this
>
> "CRLFText"
>
> etc

There are some very simple tricks that will do most of what you need with
a few s/// operations, but probably it's better to find something a bit
more developed and just plug it in.

Andrew

--
Andrew McNaughton   In Sydney and looking for work
[EMAIL PROTECTED]  http://staff.scoop.co.nz/andrew/cv.doc
Mobile: +61 422 753 792




-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [Re: [SLUG] Need Help With LWP and newlines]

2003-01-01 Thread Anthony Wood
On Mon, Dec 30, 2002 at 01:44:25PM +1100, Louis Selvon wrote:



> I get this back:
> 
> "\x0D\x0A\x3CP\x3Etest\x3C\x2FP\x3E\x0D\x0A\x3CP\x3Etest\x3C\x2FP\x3E"
> 
> I do not know what "\x3CP", "\x2FP" means. I know the other codes from the
> ASCII table.

\x3CP = "\x3C" . "P" = "test test='

-- 
Woody
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



RE: [Re: [SLUG] Need Help With LWP and newlines]

2002-12-30 Thread LS
Hi Angus:

I think I can see my problem. I'm surprise I did not see
it before.

After studying the format returned from the form, as pasted below,
all the body has to be in HTML format. I'm sending the data as plain
text from the LWP script.

This raises my next question, does LWP has a way to send data
between text and html format, or this is not even related to
LWP at all ?

I don't want to have to write something to convert the text
message in HTML format. There must be some Perl module that
does this, or something else ?

Anyone know what I need ?

I will try a small HTML test to the form, and see how the email
I receive back is formatted, just to make sure that this is the 
problem. 

Basically after each paragraph I need this 

"CRLFText" 

etc


Louis.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
Of Louis Selvon
Sent: Monday, December 30, 2002 01:44 PM
To: Angus Lees; Louis Selvon
Cc: [EMAIL PROTECTED]
Subject: Re: [Re: [SLUG] Need Help With LWP and newlines]


>Angus Lees <[EMAIL PROTECTED]> wrote:
Hi Angus.

>you probably need to have CRLF pairs instead of simple newlines (\r\n
instead of \n).

*** Yes I am using "\r", and "\n". When you say CRLF pairs are your
saying "\r\x0A" or "CRLF" ?

>are you able to dump the mail as it goes through the web server?

*** I can only dump the mail from my end of the server. The form
processing my request is on another server that is not mine. But when I
post the mail from the LWP script, I get an email as well of what I
sent.

>it might even be the final mail client helpfully "wordwrapping" email;
apparently some of them do that.

*** I do not know. But what I did was download the form to my server,
and edited the  action tag to a script of mine that dumps how the
data is sent by the form after processing. A sample output is shown
here.

I typed this in the form body text area from my browser:

"test

test"

I get this back:

"\x0D\x0A\x3CP\x3Etest\x3C\x2FP\x3E\x0D\x0A\x3CP\x3Etest\x3C\x2FP\x3E"

I do not know what "\x3CP", "\x2FP" means. I know the other codes from
the ASCII table.

But my LWP script is sending the following:

"test\n\ntest", and even "test\r\rtest" .

Both shows this when the mail is actually posted:

"testtest".

Louis.

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [Re: [SLUG] Need Help With LWP and newlines]

2002-12-29 Thread Louis Selvon
>Angus Lees <[EMAIL PROTECTED]> wrote:
Hi Angus.

>you probably need to have CRLF pairs instead of simple newlines (\r\n
instead of \n).

*** Yes I am using "\r", and "\n". When you say CRLF pairs are your saying
"\r\x0A" or "CRLF" ?

>are you able to dump the mail as it goes through the web server?

*** I can only dump the mail from my end of the server. The form processing my
request is on another server that is not mine. But when I post the mail from
the LWP script, I get an email as well of what I sent.

>it might even be the final mail client helpfully "wordwrapping" email;
apparently some of them do that.

*** I do not know. But what I did was download the form to my server, and
edited the  action tag to a script of mine that dumps how the data is
sent by the form after processing. A sample output is shown here.

I typed this in the form body text area from my browser:

"test

test"

I get this back:

"\x0D\x0A\x3CP\x3Etest\x3C\x2FP\x3E\x0D\x0A\x3CP\x3Etest\x3C\x2FP\x3E"

I do not know what "\x3CP", "\x2FP" means. I know the other codes from the
ASCII table.

But my LWP script is sending the following:

"test\n\ntest", and even "test\r\rtest" .

Both shows this when the mail is actually posted:

"testtest".

Louis.

--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Need Help With LWP and newlines

2002-12-29 Thread Angus Lees
At Wed, 25 Dec 2002 10:16:31 +1100, Louis Selvon wrote:
> I am using LWP module from Perl to automatically login into a member area.
> 
> The purpose of the form is to send an email to all my members. My problem is
> that the contents (body) of the email that is coming from:
> 
>   my server (client) -> server where forms resides
> 
> does now show the newlines, and returns. When I print out the contents I am
> sending before posting to the form from my end, I can see that the email
> message is formatted with the newlines, and returns as expected.
> 
> At the other end the email that went to the members cannot detect the
> returns/newlines.

you probably need to have CRLF pairs instead of simple newlines (\r\n
instead of \n).

are you able to dump the mail as it goes through the web server?

it might even be the final mail client helpfully "wordwrapping" email;
apparently some of them do that.

-- 
 - Gus
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug