I'm trying to write an iw_value replacement module that will do bbcode, very similar to the markup on this board, and I can't seem to get it to work:
package TeamSite:

T::my_value;
@ISA = qw( TeamSite:

T::iw_xml );
sub start
{
my ($this, $iw_parser, $start_string) =
@_;
my $name = $this->get_attrib('name','perl_name');
# this just always seems to generate some kind of error.
# is there something in the escaping that I'm missing?
$this->emit_perl(" my \$iname = $name; ");
$this->emit_perl(" \$iname =~ s/\[(\/?)b\]/<(\$1)strong/gi; ");
$this->emit_perl("iwpt_output\($iname);");
# comment the code above, and uncomment this,
# and I get output, but without the regex applied
# $name=~ s/\[(\/?)b\]/<(\$1)strong/gi;
# $this->emit_perl("iwpt_output\($name);");
}
1;