Index: trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
===================================================================
--- trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 9898)
+++ trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 10125)
@@ -1,5 +1,5 @@
 # Copyright (c) 2006  Paul Price, Joshua Hoblitt
 #
-# $Id: Config.pm,v 1.4 2006-11-07 22:56:41 price Exp $
+# $Id: Config.pm,v 1.5 2006-11-22 00:32:13 price Exp $
 
 package PS::IPP::Config;
@@ -164,5 +164,5 @@
     }
 
-    my $file = _mdLookupMD($filerules, $name); # The file of interest
+    my $file = _mdLookupMDwithRedirect($filerules, $name); # The file of interest
     unless (defined $file) {
 	carp "Can't find $name within FILERULES in camera configuration.\n";
@@ -239,4 +239,27 @@
 
 
+# Lookup the metadata, checking the type is MD; may be redirection
+sub _mdLookupMDwithRedirect
+{
+    my $mdc = shift;		# Metadata config to look up
+    my $name = shift;		# Name of item to look ip
+
+    # Iterate through the array of hashes
+    foreach my $item (@$mdc) {
+	if ($item->{name} eq $name) {
+	    if ($item->{type} eq "STR") {
+		# Redirect
+		return _mdLookupMDwithRedirect($mdc, $item->{value});
+	    }
+	    carp "$name within metadata is not of type METADATA.\n" unless $item->{class} eq "metadata";
+	    return $item->{value};
+	}
+    }
+
+    carp "Unable to find $name within metadata.\n";
+    return undef;
+}
+
+
 1;
 
