Akopia Akopia Services

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

Re: [mv] 'UserTag realperl' question



Hello,

I got realperl working, but I still need to know how to push [item-code]
into a vector.

Thanks,
Murrah Boswell

OTR Comm wrote:
> 
> 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


_______________________________________________
Minivend-users mailing list
Minivend-users@minivend.com
http://lists.akopia.com/mailman/listinfo/minivend-users


Search for: Match: Format: Sort by: