eval{...} now works for type="swish" also...
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 7 Mar 2004 22:51:14 +0000 (22:51 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 7 Mar 2004 22:51:14 +0000 (22:51 +0000)
git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@234 13eb9ef6-21d5-0310-b721-a9d68796d827

all2xml.pl

index 7157de0..8c3c1f7 100755 (executable)
@@ -211,7 +211,7 @@ sub data2xml {
                        # placeholder for all repeatable entries for index
 
                        sub chk_eval($) {
-                               my $data = shift;
+                               my $data = shift || return;
                                if ($data =~ s/eval{([^}]+)}//) {
                                        if (eval "$1") {
                                                return $data;
@@ -291,16 +291,17 @@ sub data2xml {
                                }
                                # type="swish" ; field for swish
                                if ($swish) {
+                                       my $tmp;
                                        if ($filter && ($s || $se)) {
                                                no strict 'refs';
                                                my $tmp = join(" ",&$filter($swish)) if ($s || $se);
-                                               $swish_data .= $tmp if ($s);
-                                               $swish_exact_data .= "xxbxx $tmp xxexx " if ($se && $tmp ne "");
-
                                        } else {
-                                               $swish_data .= $swish if ($s);
-                                               $swish_exact_data .= "xxbxx $swish xxexx " if ($se && $swish ne "");
+                                               $tmp = $swish;
                                        }
+
+                                       $tmp = chk_eval($tmp);
+                                       $swish_data .= $tmp if ($s);
+                                       $swish_exact_data .= "xxbxx $tmp xxexx " if ($se && $tmp ne "");
                                }
 
                                # type="display" ; field for display