[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 Mike Lerley <mike@bfent.com> ******
Ahhh.... I understand now.
However: I think this is a related question.
Trying to determine whether or not [data...] returns a value. Snippet:
my $sname;
$sname="[data songs name $upc]";
if(length($sname)>0) {
blah;
}
But upon inspection, length($data) ALWAYS returns 33. Doesn't matter
what's in there. $data always contains the correct stuff (i.e. song
name or nothing if not found), but length() never returns the length!
On the other hand:
my $hi;
$hi="1234567";
length($hi);
returns 7.
Argh! Please help. I don't have to use length() to determine results;
if anyone has better ideas I'm quite open. Thanks...
-mike
Frank Miedreich wrote:
> 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]
--
Mike Lerley, Technical Systems Administrator
Goold Health Systems
24 Stone Street
Augusta, ME 04330
Email mike@bfent.com
Phone (207) 622-3298
Fax (207) 623-5125
-
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