Thu 9 Nov 2006
The author of this module chose to use some file scoped variables in a module. This effectively created some global variables used outside the sub. This is not the recommended way to write a subroutine, but I needed an example and this one was handy.
-
my $htmltree;
-
my $node;
-
my @prevnodes;
-
my $htmloutput;
-
-
sub start {
-
my $newnode = {};
-
-
$newnode->{tag} = $tagname;
-
$newnode->{$key} = $attr->{$key};
-
}
-
$newnode->{content} = [];
-
$node = $newnode->{content};
-
}