Hi. I'm trying to write a syntax module that rewrites certain tags in HTML, but I'm getting lots of errors when I try to rewrite an attribute that's set by [+ $foo +]. An example is:
--cut here--
[$ syntax +III::MinimalTag $]
[- $attribute = "moo"; -]
<test attribute="[+ $attribute +]"></test>
--cut here--
The III::MinimalTag module is:
--cut here--
package III::MinimalTag;
use HTML::Embperl::Syntax qw{:types} ;
use HTML::Embperl::Syntax::HTML ;
# We inherit the generic HTML support from HTML::Embperl::Syntax::HTML
use vars qw(@ISA);
@ISA = qw(HTML::Embperl::Syntax::HTML) ;
sub new {
my $class = shift;
my $self = HTML::Embperl::Syntax::HTML::new($class);
# initialise ourselves when an object is created if it hasn't
# been done already
if (!$self->{-randomInit}) {
$self->{-randomInit} = 1;
init($self);
}
return $self;
}
# initialise things and define our new syntax handling
sub init {
my $self = shift;
# redefine the tags we want to manipulate attributes for
$self->AddTag('test', ['attribute'], undef, undef, {
perlcode => q[ {
# _ep_sa is an apparently undocumented function which
# allows you to rewrite an attribute of the current node
# specified by %$n%
_ep_sa(%$n%, 'attribute', %&'attribute%);
}],
});
}
1;
--cut here--
I'm using Embperl 2.0b4_dev-5 on a linux machine with perl 5.6.1
When I request this with a web browser, I get random results
including:
* Segmentation Faults in apache
* <test attribute=""></test>
* Sometimes a response that seems to be an endless loop of
moomoomoomoomoomoomoomoo....
Michael
Interactive Investor Trading Limited trading as
"Ample" is an independent intermediary regulated by
the Financial Services Authority. Registered in
England with registered office at 142 Holborn, London
EC1N 2NQ and Company Registration Number 3699618. A
member of the AMP Group. We may record and/or monitor
telephone calls or intercept other telecommunications
between us. This is to protect both of us and for
training purposes.
The information in this email is confidential and may
be legally privileged. It is intended solely for the
addressee and access to this email by anyone else is
unauthorised. If this email has come to you in error
you must not read or forward the email to anyone,
please reply to this email and highlight the error.
Although this message and any attachments are believed
to be free of any virus or other defect that might
affect any computer system into which it is received
and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility
is accepted by Interactive Investor Trading Limited
for any loss or damage in any way arising from its
use.
MinimalTag.pm
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
