dynamic includes
Josh Narins <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.petal |
|---|---|
| Message-ID | <[email protected]> |
I've copied Mr. Smiths' code below, I used it as is.
William, to make a suggestion, I'd probably want to see one of the
peices of code. Also, there are some modules which are much larger
resources hogs than others. CGI.pm and IO::* are among them.
Maybe it'd just be best to write any future modules in mod_perl...
> You need to build an include: modifier. Name this Include.pm and put it
> in your perl path under Petal/Hash
>
> package Petal::Hash::Include;
>
> use strict;
> use warnings;
>
> use base qw/Petal::Hash::String/;
>
> sub process {
> my ($self, $hash, $args) = @_;
>
> my $fn = $self->SUPER::process($hash, $args);
> my $tpl = Petal->new($fn);
> return $tpl->process($hash);
> }
>
> 1;
>
>
> you can then do things like
>
> <tag petal:replace="structure include: ${extra_content}" />
>
> Where extra_content is a file that needs to be parsed.
>
> /me wonders why this was never added to Petal...
>
signature.asc
(application/pgp-signature, 232 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFCCjAFqmX4LWzvJuARAqt3AJ4/L25abmaRikMxBwSFgD/nck2AZACglMVM G9tZ7CdO/BD281OwhL1ogvI= =ta+P -----END PGP SIGNATURE-----