Josh Narins | 12 Aug 15:38

Instead of /tmp directory?


Hi guys,

Sorry the list is so slow.

I was hoping you could tell me what option I could change so that the
petal_cache and petal_debug files didn't end up in /tmp. I'd like to
change them to /tmp/petal, if that helps (doubtful, but one never
knows).

In my copious spare time (well, yes and no, actually) I'll probably be
doing a small design project for a site (200 hits/day?) in Petal. It's
for computer people, so the exposure might be good.

Don't know for sure yet, though. Some of it has to do with how savvy the
client is.

Jonathan Vanasco | 15 Aug 19:46
Favicon

Petal and Mod_Perl?

Is there a way to pre-cache petal templates in mod_perl before apache  
forks?

Google hasn't helped me on this.

Josh Narins | 16 Aug 17:13

Re: Petal and Mod_Perl?

> Is there a way to pre-cache petal templates in mod_perl before apache  
> forks?
> 
> Google hasn't helped me on this.

Well, this isn't help so much from the Petal end,
but if you want something done pre-fork, do it in your startup.pl script

#httpd.conf
PerlRequire                /path/to/startup.pl

or in another PerlRequire script.

NOTE: Anyone who can edit PerlRequire'd scripts effectively has root
access during apache startup.

There are also PerlInitHandlers

#also httpd.conf
PerlInitHandler  Module::Name

that get called once each time a child starts up.

Jonathan Vanasco | 16 Aug 17:20
Favicon

Re: Petal and Mod_Perl?


Yeah - I know that It would need to e in startup.pl -- I was just 
wondering if there were some sort of commonplace instructions for 
having the templates read and compiled during the prefork time.

i have a directory of templates and petal is just going to be running 
on this apache instance - i was hoping there was some standard way to 
just load them all into the apache process (as i'm already doing with 
petal and my scripts), so that the apache children share all of it.

Bruno Postle | 17 Aug 01:26
X-Face

Re: Instead of /tmp directory?

On Fri 12-Aug-2005 at 09:38 -0400, Josh Narins wrote:
> 
> I was hoping you could tell me what option I could change so that the
> petal_cache and petal_debug files didn't end up in /tmp. I'd like to
> change them to /tmp/petal, if that helps (doubtful, but one never
> knows).

Petal uses File::Spec->tmpdir() for this, so you can change the
directory for the cached templates by setting $ENV{TMPDIR}.

--

-- 
Bruno

Jonathan Vanasco | 19 Aug 06:20
Favicon

Petal::CodePerl doesn't seem to work

Problem:
I can't seem to get Petal::CodePerl to work

Explanation:

(happens with both
   use Petal::CodePerl;
  and
   use Petal;
   $Petal::CodeGenerator = 'Petal::CodePerl::CodeGenerator'\
)

Part 1:

   If I include a condition which works fine in Petal without CodePerl,
     <span tal:condition="true: RS_ShowMe">show me</span>

   Petal sadly tells me:
Undefined subroutine &Petal::XML_Encode_Decode::encode called at  
(eval 20) line 11.

I can't find anything that would suggest the syntax is change for if  
statements.  Removing the if statement, petal::codeperl parses things  
fine.

Part 2

To make things worse, if I were  to look at the debug in /tmp ...
      $res .= do {
         my $res = $hash->get_encoded ('RS_CoreElement');
(Continue reading)

Fergal Daly | 19 Aug 11:27
Picon

Re: Petal::CodePerl doesn't seem to work

Petal::CodePerl was mainly a proof of concept. It was fairly dependent
on Petal's internals. I was slowly getting patches into Petal that
would allow it (or something else) to plug in cleanly but I think JMH
didn't like some of the patches and I got too busy to push for them.

Petal has changed internally a lot since then (all this get_encoded
stuff for example) so Petal::CodePerl would need some work to get it
up to date and I don't have the time or interest to do that. If you
are interested, let me know and I can explain in more detail.
Otherwise I'll release a new version onto CPAN with a big "OUT OF
DATE" message in the docs,

F

On 8/19/05, Jonathan Vanasco <jvanasco@...> wrote:
> Problem:
> I can't seem to get Petal::CodePerl to work
> 
> Explanation:
> 
> (happens with both
>    use Petal::CodePerl;
>   and
>    use Petal;
>    $Petal::CodeGenerator = 'Petal::CodePerl::CodeGenerator'\
> )
> 
> Part 1:
> 
>    If I include a condition which works fine in Petal without CodePerl,
(Continue reading)

jonathan vanasco | 19 Aug 14:50
Favicon

Re: Petal::CodePerl doesn't seem to work


i have the interest, but neither the ability or time.at the moment --  
putting out of date on CodePerl would be good -- putting a message in  
the main petal docs would be nice as well

On Aug 19, 2005, at 5:27 AM, Fergal Daly wrote:

> Petal::CodePerl was mainly a proof of concept. It was fairly dependent
> on Petal's internals. I was slowly getting patches into Petal that
> would allow it (or something else) to plug in cleanly but I think JMH
> didn't like some of the patches and I got too busy to push for them.
>
> Petal has changed internally a lot since then (all this get_encoded
> stuff for example) so Petal::CodePerl would need some work to get it
> up to date and I don't have the time or interest to do that. If you
> are interested, let me know and I can explain in more detail.
> Otherwise I'll release a new version onto CPAN with a big "OUT OF
> DATE" message in the docs,
>
> F

Jonathan Vanasco | 19 Aug 20:50
Favicon

Re: Petal::CodePerl doesn't seem to work


Just wondering -- is there a last-known working version number of  
petal for Code:Perl, or any sort of speed benchmarks?

maybe i'll look into learning enough of petal to try and update it  
myself - i really like TAL from my python experience with it -- and  
i'm half-assedly considering writing a module to turn TAL templates  
into html::template documents to use its JIT compiler

On Aug 19, 2005, at 5:27 AM, Fergal Daly wrote:

> Petal::CodePerl was mainly a proof of concept. It was fairly dependent
> on Petal's internals. I was slowly getting patches into Petal that
> would allow it (or something else) to plug in cleanly but I think JMH
> didn't like some of the patches and I got too busy to push for them.
>
> Petal has changed internally a lot since then (all this get_encoded
> stuff for example) so Petal::CodePerl would need some work to get it
> up to date and I don't have the time or interest to do that. If you
> are interested, let me know and I can explain in more detail.
> Otherwise I'll release a new version onto CPAN with a big "OUT OF
> DATE" message in the docs,

Josh Narins | 26 Aug 21:39

Re: Instead of /tmp directory?

Bruno,

> On Fri 12-Aug-2005 at 09:38 -0400, Josh Narins wrote:
> > 
> > I was hoping you could tell me what option I could change so that the
> > petal_cache and petal_debug files didn't end up in /tmp. I'd like to
> > change them to /tmp/petal, if that helps (doubtful, but one never
> > knows).
> 
> Petal uses File::Spec->tmpdir() for this, so you can change the
> directory for the cached templates by setting $ENV{TMPDIR}.

Thanks, but that changes other things, too.

I hope future versions allow passing a variable to the Petal
instantiation to set the tmpdir.


Gmane