MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Does AllowGlobal cause Subs to fail?



******    message to minivend-users from Christian =?iso-8859-1?Q?Gr=E4fe?= <cg@cityline.net>     ******

I recall seeing a question similar to this on the mailing list, but the
effects were
different and I can't recall if the problem was resolved:

There are two subs in my catalog.cfg like this:

Sub <<EOF
sub cat_choice {
        my ($name,$selid) = @_;
        my $query = <<EOQ;
[sql array]
select c1.id,c1.bezeichnung,c1.nummer,c2.nummer  from categories c1,
categories 
c2 where c1.parent=c2.id order by c2.id, c1.bezeichnung
[/sql categories]
EOQ
        my $result = Vend::Interpolate::safe_tag($query);
        #my $result = safe_tag($query);
        my $arr = eval $result;
        my $rec;
        my $catselect = "<select name=\"$name\">\n";
        $catselect.='<option value="NULL" '.($selid?'':'selected').'>--
keine gew&auml;hlt -- /option>'."\n";
        foreach $rec (@$arr) {
          my $id = $rec->[0];
          my $bez1 = $rec->[1];
          my $num1 = $rec->[2];
          my $num2 = $rec->[3];
          $catselect .= "<option value=\"$id\" ".($selid eq
$id?'selected':'').">$num2 / $num1 $bez1</option>\n";
        }
        $catselect .= "</select>\n";
        
        return $catselect;
}
EOF

Sub <<EOF
sub dummy {

        return '...';
}
EOF

AllowGlobal is set in the minivend.cfg for this catalog. The sub
"cat_choice" works just 
fine when I remove the second sub "dummy" (which would evetually be
replaced by a more
meaningful sub, of course). 

But if there is more than one sub in the catalog.cfg, all calls to subs
except the one that
was defined last result in the following output in error.log:
... ... [16/March/1999:18:15:40 +0100] schoenherr
/cgi-bin/schoenherradm/process Undefined perl sub cat_choice

This doesn't happen if AllowGlobal is not set, but I need it because the
call to safe_tag() doesn't
seem to work otherwise (neither "&safe_tag()" nor
"&Vend::Interpolate::safe_tag()").

Any hints? Any ideas? Might this be a bug? I tried Versions 3.11 and
3.12beta10...

Christian (getting more and more desperate...)

-- 
+-------------------------------------------------------------------------+
| Christian Graefe                             Voice: +49 (0)40 53773-0   |
| Cityline Internet Services                   Fax  : +49 (0)40 53773-200 |
| http://www.cityline.net/                     Email: cg@cityline.net     |
+-------------------------------------------------------------------------+

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: