how do define sub routines for new tags?
Calle Aasman (md4calle@mdstud.chalmers.se)
Thu, 19 Jun 1997 16:03:41 +0200 (MET DST)
Hi, I wish to define sub routines for <script>-tag and comments, how can I
do this? I guess this is a frequent asked question, but I havn't found any
examples on how to do this...can someone help me out?
I've included the code I got to redefine the sub routines for existing
tags, and it works fine would be great if one could define new sub
routines such easy..
all best,
/Calle
**************************************************************************
* * My homepage about the author Tom Holt: *
* /_\ http://www.mdstud.chalmers.se/~md4calle/holt/ *
* { ~._.~ } *
* ( Y ) other things like OnLine Guitar Archive linkpage *
* ( )~*~( ) and heaps of musiclinks can be found at *
* (__)-(__) http://www.mdstud.chalmers.se/~md4calle/ *
**************************************************************************
#!/usr/local/bin/perl
package FormatXX;
require HTML::Formatter;
@ISA=qw(HTML::Formatter);
sub new {
my $class = shift;
bless {}, $class;
}
sub img_start
{
print "tobak";
# $tobak = "reine";
#shift->out(shift->attr('alt') || "[image]");
}
sub h1_start {
#shift->out("[MECK2000]");
print "Header detected";
}
sub out {
my ($self, $text) = @_;
#print "$text";
$meck=$meck.$text;
}
package main;
use HTML::Parse;
my $html = parse_htmlfile("frame.html");
my $form = new FormatXX;
print $form->format($html);
sub HTML::FormatText::table_start { 1; }