Louis LeBlanc wrote:

> Hey all.  I don't know how many people are lurking here, since the
> list seems to be very light traffic (the lightest of 8 I sub to), but


That's because mod_perl has no bugs :) so we talk about the weather mostly.

> I have a question regarding PerlSetVar and strings.
> 
> Here is what I'm trying to do:
> In httpd.conf:
> <Location /MyHandler>
>   . . .
>         PerlSetVar MailMsg "Access Report \
>         This is a mail message spanning several \
>         lines that I would like to mail to a \
>         particular address when the handler is \
>         invoked.  \
>         Unfortunately, it all winds up on one line and \
>         any \n included do not get translated."
> </Location>
> 
> And in my module, I am successfully sending this message to the email
> address, but it arrives looking like this:
> 
> Access Report         This is a mail message spanning several         lines that I 
>would like to mail to a         particular address when the handler is         
>invoked.          Unfortunately, it all winds up on one line and         any \n 
>included do not get translated."
> 
> And the darn thing is all on one line.  '\n' is not translated, etc.
> It looks like the string is proveded as if enclosed in single quotes.
> Which is bad.

Probably you are the first one that needed PerlSetVar to work with "\n". 
Why don't you use startup.pl or C<Perl> sections to set the text, where 
you have a complete control over the string?

Yet another solution would be to use this:

PerlSetVar Foo "first line"
PerlAddVar Foo "second line"
PerlAddVar Foo "third line"
....

Or you can use the hack suggested by Steven.

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/

Reply via email to