[ic] Enligment of Embedded perl

delionsweb - minivend minivend@delionsweb.net
Fri, 10 Nov 2000 20:27:52 -0500


Well first I think you have to stop drinking ... ;-)

(Real answers below)

At 08:12 PM 11/10/2000, you wrote:
>HOW Y'ALL DOING?
>
>I HAVE TWO QUESTION TO ASK THESE NICE PEOPLE OUT THERE:
>
>FIRST, I'M TRYING TO OUTPUT THE RANGE OF hard liquor, BUT I'M GETTING ONLY
>ONE OR FIRST RETURN VALUE ONLY.  COULD YOU LET ME KNOW WHAT I'M DOING
>WRONG(the code is below) ?
>
>The right output supposed to give me:
>vodka
>whisky
>rum
>tequila
>cognac
>bourbon
>
>
>But I'm getting:
>vodka
>
>Only returns the first value How do I do to return the next following values?
>***********************************************************
>This is the code
>[perl]
>@f = ("vodka","whisky","rum","tequila","cognac","bourbon");
>
>foreach $zima (@f){
>return "Here it is $zima <br>";
>}
>[/perl]
>*************************************************************

Remember that the [perl] block 'exists' with the return. We see a lot of 
people asking this and the principle should be documented in a 
Tips'n'Tricks or Pitfalls document ...

So what you mean to do is:
$return = "Here it is <br>";
foreach $zima (@f){
$return .= "$zima <br>";
}
return $return;
[/perl]



>Second,
>If I have
>[loop search="
>ra=yes
>st=db
>sq=select * from products where sku = 'something'
>ml=9999
>"]
>AND I WANT TO PUSH THE VALUES FROM [loop-data products sku] TO THE ARRAY.
>[PERL]
>MY @ARRAY;
>PUSH (@ARRAY, [LOOP-DATA PRODUCTS SKU]);
>[/PERL]
>IS THERE ANY OTHER WAY TO DO THIS? or LOOP->tag to grap the values and push
>into array?
>
>Thank y'all,
>MH

Well I am not sure but I think that if all you want is the sku then a 
"select sku ..." will be better and a [loop-code] might achieve the same thing.
Also, their might be a way of writing the entire loop in [perl] block but 
that is as much as I know ...


>_______________________________________________
>Interchange-users mailing list
>Interchange-users@www.minivend.com
>http://www.minivend.com/mailman/listinfo/interchange-users