Index: trunk/PS-IPP-Metadata-Config/lib/PS/IPP/Metadata/Config.pm
===================================================================
--- trunk/PS-IPP-Metadata-Config/lib/PS/IPP/Metadata/Config.pm	(revision 9496)
+++ trunk/PS-IPP-Metadata-Config/lib/PS/IPP/Metadata/Config.pm	(revision 9758)
@@ -1,5 +1,5 @@
 # Copyright (c) 2005  Joshua Hoblitt
 #
-# $Id: Config.pm,v 1.26 2006-10-12 02:09:10 jhoblitt Exp $
+# $Id: Config.pm,v 1.27 2006-10-27 02:15:45 jhoblitt Exp $
 
 package PS::IPP::Metadata::Config;
@@ -49,4 +49,8 @@
     # multi-symbols
     $self->_merge_duplicates( $tree ) or return undef;
+
+    # translate NULL values into perl undefs (Parse::RecDescent can't return
+    # undefs, args)
+    $self->_fix_nulls( $tree ) or return undef;
 
     #print Dumper($tree);
@@ -106,4 +110,27 @@
 }
 
+sub _fix_nulls {
+    my ( $self, $tree ) = @_;
+
+    # Iteratate through the parse tree looking for values of NULL and
+    # translating them into Perl undefs
+    for (my $i = 0; $i < @{$tree}; $i++) {
+        my $elem = $tree->[$i];
+
+        # recurse through nested metadata
+        if ( $elem->{class} eq "metadata" ) {
+            $self->_fix_nulls( $elem->{value} );
+        }
+
+        # force stringification of $elem->{value} -- specifically because you
+        # can't compare a DateTime object to a string value
+        if ("$elem->{value}" eq "NULL") {
+            $elem->{value} = undef;
+        }
+    }
+
+    return 1;
+}
+
 1;
 
