[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[mv] 'UserTag realperl' question
Hello,
I read in some earlier posting from Anthony Ball about how to configure
'realperl' by setting up UserTags in minivend.cfg.
I added:
UserTag realperl HasEndTag
UserTag realperl CanNest
UserTag realperl Interpolate
UserTag realperl Routine <<EOF
sub {
my $str = eval {
eval $_[0] or die;
};
return "<PRE>$@</PRE>" if $@; # This should show errors
return $str;
}
EOF
like he suggested and restarted my minivend server.
Then, in pages/ord/checkout.html I have a code snippet:
[realperl]
open (MV,"+>>/path/to/catalogs/artisansorb/pages/mvchk");
print MV "In checkout:\n";
close(MV);
[/realperl]
Now when I go to the checkout page, I get:
1
1
1
Died at (eval 2) line 3.
Anybody have any ideas about what I am doing wrong here?
Another question, assuming that I can get the snippet above working, how
can I push the [item-codes] into a perl vector?
That is, ho can I do something like (i am working in
/pages/ord/checkout.html):
[item-list]
[realperl]
push (@item_codes, [item-code]);
[/realperl]
[/item-list]
and then later in checkout, I want to:
[realperl]
open a mysql database
foreach $item_code (@item_codes) {
store them in the mysql database
}
[/realperl]
I think I need to escape the minivend variable '[item-code]' in my perl
code, but how do I do this?
Thanks,
Murrah Boswell
_______________________________________________
Minivend-users mailing list
Minivend-users@minivend.com
http://lists.akopia.com/mailman/listinfo/minivend-users