summaryrefslogtreecommitdiff
path: root/lib/TUWF/XML.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-15 16:07:13 +0100
committerYorhel <git@yorhel.nl>2011-01-15 16:07:13 +0100
commitd61ba5450ec359b55db8767c41a87c888c0f6a85 (patch)
treeb7a6587e8f2d1d34af36640ab6abbcb56b9e1dd2 /lib/TUWF/XML.pm
parent99ae00c40751b2008278756b2a6af5245ea7ff63 (diff)
TUWF::XML: Added 'default' option to new()
To replace the not-really-nice way of assinging to $TUWF::XML::OBJ.
Diffstat (limited to 'lib/TUWF/XML.pm')
-rw-r--r--lib/TUWF/XML.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/TUWF/XML.pm b/lib/TUWF/XML.pm
index 7934f24..fa0e45f 100644
--- a/lib/TUWF/XML.pm
+++ b/lib/TUWF/XML.pm
@@ -49,10 +49,12 @@ BEGIN {
sub new {
my($pack, %o) = @_;
- return bless {
+ my $self = bless {
%o,
stack => [],
}, $pack;
+ $OBJ = $self if $o{default};
+ return $self;
};