From 46d86b4ed6f355f9257cfa3c5b87b10d054ea8cf Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 11 Feb 2011 16:23:33 +0100 Subject: [PATCH] Added tracking of dependencies from MJ's web It is up to external modules to read the list of dependencies and process it somehow. --- UCW/Temple.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UCW/Temple.pm b/UCW/Temple.pm index 7224ac4..eded624 100644 --- a/UCW/Temple.pm +++ b/UCW/Temple.pm @@ -24,6 +24,12 @@ sub out { return; } +our %deps = (); + +sub add_depend($) { + $deps{$_[0]} = 1; +} + sub get_nested($$$) { my ($r,$left,$right) = @_; pos $$r = pos($$r)-1; @@ -134,6 +140,7 @@ sub parse_string($) { sub parse_file($) { my ($name) = @_; + add_depend($name); my $fh = new IO::File $name; die "Unable to open $name: $!" unless defined $fh; my $text; @@ -190,6 +197,7 @@ sub include { sub load { my $f = shift @_; (!defined($f) || @_) and die "\@load requires only one argument"; + UCW::Temple::add_depend($f); require $f; return; } -- 2.39.5