You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by 'Kathryn Andersen' <ka...@katspace.homelinux.org> on 2006/03/26 00:54:23 UTC

Re: Text to HTML recipe making

On Tue, Dec 20, 2005 at 09:48:15PM +0100, Gerald Richter wrote:
> The other one is to create a syntax module, which uses HTML::TextToHTML for
> the actual work.
> 
> To do so, just make a copy of Embperl/Syntax/Perl.pm, then in the call to
> AddInitCode you would pass some code like:

[snip]

Well, I have now actually gotten around to trying to implement it, and I
can't get it to work.  I am completely stumped!
 
Attached is the module I made, Embperl::Syntax::TextToHTML
and I have a recipe which correctly sets the syntax to 'TextToHTML' when
trying to process a .txt file.  However, hear is an example of the error
I get whenever I try to display a converted text file:

[13125]ERR: 24: Error in Perl code: Missing right curly or square
bracket at /home/kat/kat_web/katspace2/html/computers/linux_tips.txt
line 16, at end of line
    syntax error at
/home/kat/kat_web/katspace2/html/computers/linux_tips.txt line 16, at
EOF

I've changed the code around trying to get it to work, and I get worse
errors, like it's trying to interpret the text file as perl code, and it
gives a flurry of perl syntax error messages.

Please can you help?  This is a showstopper for me.  Either that, or can
we have the plugin mechanism you were thinking of doing?

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

Re: Text to HTML recipe making

Posted by 'Kathryn Andersen' <ka...@katspace.homelinux.org>.
On Tue, Mar 28, 2006 at 05:28:46AM +0200, Gerald Richter wrote:
> 
> > 
> > Maybe there's something about Embperl which doesn't like 
> > __DATA__ sections?
> > 
> 
> I can't think of any reason why it shouldn't work. I will give it a try when
> I habe some more spare time, but at the moment I am releaseing some critical
> applications for our company, which must be done first, sorry!

Don't worry about it, I found the mistake, it was my mistake: I had a
local $/ in the wrong scope, which messed everything up.
 
Not a good idea to program on not enough sleep...

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Text to HTML recipe making

Posted by Gerald Richter <ri...@ecos.de>.
> 
> Maybe there's something about Embperl which doesn't like 
> __DATA__ sections?
> 

I can't think of any reason why it shouldn't work. I will give it a try when
I habe some more spare time, but at the moment I am releaseing some critical
applications for our company, which must be done first, sorry!

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Text to HTML recipe making

Posted by 'Kathryn Andersen' <ka...@katspace.homelinux.org>.
On Tue, Mar 28, 2006 at 06:36:13AM +1000, 'Kathryn Andersen' wrote:
> On Mon, Mar 27, 2006 at 08:59:31PM +0200, Gerald Richter wrote:
> > > 
> > > Well, I have now actually gotten around to trying to 
> > > implement it, and I can't get it to work.  I am completely stumped!

[snip]

Never mind.
1) I found the log.  I couldn't see anything wrong with the code there
either.
2) I have given up trying to get Embperl::Syntax::TextToHTML working, in
favour of a workaround.  In my base.epl file, I check to see if the
desired file is a plain text file, and if so, read it in, convert it,
and then pass the string result to Execute as an input=> string.
It mostly works, though HTML::TextToHTML doesn't appear to be reading
its __DATA__ handle (which it needs for some of the conversions, which
do not work).

Maybe there's something about Embperl which doesn't like __DATA__
sections?

Kathryn Andersen
-=-=-=-=-=-=-=-=-
"Oh, that's marvelous.  We're not sure where we are, but if they
were sure they wouldn't know where it was anyway."
		-- Vila Restal		(Blake's 7: The Web [A5])
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Text to HTML recipe making

Posted by Gerald Richter <ri...@ecos.de>.
> 
> I can't get the debug to work.
> 
> I give
> 
> Embperl_Debug 0x8000000
> 

Embperl tries to write it to /tmp/embperl.log, you can set the path with
Embperl_Log

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Text to HTML recipe making

Posted by 'Kathryn Andersen' <ka...@katspace.homelinux.org>.
On Mon, Mar 27, 2006 at 08:59:31PM +0200, Gerald Richter wrote:
> > 
> > Well, I have now actually gotten around to trying to 
> > implement it, and I can't get it to work.  I am completely stumped!
> >  
> > Attached is the module I made, Embperl::Syntax::TextToHTML 
> > and I have a recipe which correctly sets the syntax to 
> > 'TextToHTML' when trying to process a .txt file.  However, 
> > hear is an example of the error I get whenever I try to 
> > display a converted text file:
> 
> Basicly it seems to be ok. The best is to set Embperl_Debug to dbgCompile =
> 0x8000000 (or set it to 0x7ffffff, which will output a lot of debug
> informations). That would show you the Perl code Embperl generates and you
> should be able to find the missing bracket.

(tears out hair)

I can't get the debug to work.

I give

Embperl_Debug 0x8000000

in my Apache configuration file, and I get zero debug information.  Not
in my error logs, not in the page displayed.

Even if I go

Embperl_Debug 0xfffffff

I get absolutely NOTHING in the way of debug information, just the same
error message that I got before.  (Yes, I'm not dumb, I did restart Apache).

This is with Embperl 2.1.0 and Apache 2.0.55

(sigh)

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Text to HTML recipe making

Posted by Gerald Richter <ri...@ecos.de>.
> 
> Well, I have now actually gotten around to trying to 
> implement it, and I can't get it to work.  I am completely stumped!
>  
> Attached is the module I made, Embperl::Syntax::TextToHTML 
> and I have a recipe which correctly sets the syntax to 
> 'TextToHTML' when trying to process a .txt file.  However, 
> hear is an example of the error I get whenever I try to 
> display a converted text file:
> 

Basicly it seems to be ok. The best is to set Embperl_Debug to dbgCompile =
0x8000000 (or set it to 0x7ffffff, which will output a lot of debug
informations). That would show you the Perl code Embperl generates and you
should be able to find the missing bracket.

Gerald



 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org