diff Lib/IMPL/Resources/Format.pm @ 368:010ceafd0c5a

form metadata + tests
author cin
date Wed, 04 Dec 2013 17:31:53 +0400
parents 4d0e1962161c
children 2f16f13b000c
line wrap: on
line diff
--- a/Lib/IMPL/Resources/Format.pm	Tue Dec 03 17:55:36 2013 +0400
+++ b/Lib/IMPL/Resources/Format.pm	Wed Dec 04 17:31:53 2013 +0400
@@ -11,6 +11,7 @@
     
     $args ||= {};
     $resolver ||= \&_defaultResolver;
+    $string ||= '';
     
     $string =~ s/%(\w+(?:\.\w+)*)%/_getvalue($args,$1,"\[$1\]",$resolver)/ge;
     
@@ -28,7 +29,7 @@
             $obj = $resolver->($obj,$chunk);
         }
     }
-    return $obj;
+    return $obj||'<undef>';
 }
 
 sub _defaultResolver {