[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Using variables in [data ...] statement
****** message to minivend-users from Frank Miedreich <miedreich@acm.org> ******
>****** message to minivend-users from Ryan Hertz <rhertz@gyb.baits.com>
>******
>
>My guess is you need to reference $sku differently... perhaps [data albums
>small [value sku]] or something.
>
>At 06:23 AM 4/22/99 , Mike Lerley wrote:
>>****** message to minivend-users from Mike Lerley <mike@bfent.com>
>******
>>
>>I have been trying to use perl variables in a [data] statement but it's
>>not working for me. Is it designed to do this or do I need to find
>>another approach? I try something like:
>>
>>[perl interpolate=1]
>>$sku="12345";
>>[data albums small $sku]
>>[/perl]
>>
>>But I get no output and in error.log, "Bad data: albums small $sku"
>>(rather than "albums small 12345")
>>
>>Obviously I have greater plans than the perl snippet above. Please
>>help!
>>-mike
>>--
This works exactly as advertised:
1st step: minivend tag Interpolation
2nd step: Execution of perl code
This means that ALL your minivend tags in your perl code are interpolated,
before any perl will be executed, thus the code fails during the
interpolation step.
You could do:
[data base="albums" field="small" key="[perl interpolate=1]
$sku="12345";
$sku;
[/perl]"]
or:
[perl]
$sku="12345";
"\[data albums small $sku\]";
[/perl]
Cheers, Frank
--
Frank Miedreich
Max-Planck-Institut fuer psychologische Forschung
-
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