[ic] problem with perl

Hans-Joachim Leidinger jojo@leidinger.net
Thu, 18 Jan 2001 23:05:31 +0100


ACC&S wrote:
> 
>  :o((   my result  = Test and Out  blanck, nothing, nada !!??
> 
> [seti tva][data table="tva" column="taux" key="[item-field Cat_tva]"][/seti]
> [seti subtotalvar][item-subtotal noformat=1][/seti]
> 
> [perl interpolate=1 arg='scratch values']
>           my a$;
>           my b$;

Ooops! It should be as
	   my $a;
           my žb;

It was a typo! Sorry!

>           $Safe{'scratch'}->{'var1'} = $Safe{'scratch'}->{'tva'};
>           $Safe{'scratch'}->{'var2'} = $Safe{'scratch'}->{'subtotalvar'};
>           $a = $Safe{'scratch'}->{'var1'};
>           $b = ($Safe{'scratch'}->{'var2'} * $Safe{'scratch'}->{'var1'});
>           $Safe{'scratch'}->{'test'} = $a;
>           $Safe{'scratch'}->{'out'} = $b;
>           return '';
> [/perl]
> 
> tva : 0.196                     ([scratch tva])
> subtotalvar : 2500        ([scratch subtotalvar])
> test :                             ([scratch test])
> out :                              ([scratch out])
> 
> Thanks for your help

Or try

 [seti tva][data table="tva" column="taux" key="[item-field
Cat_tva]"][/seti]
 [seti subtotalvar][item-subtotal noformat=1][/seti]

Test 1: [sratch tva]<BR>
Test 2: [sratch subtotalvar]<BR>
 
 [perl interpolate=1 arg='scratch values']
           my $a;
           my $b;
	   my $c;
           $a = $Safe{'scratch'}->{'tva'};
           $b = $Safe{'scratch'}->{'subtotalvar'};
           $c = $a * $b;
           $Safe{'scratch'}->{'test'} = $a;
           $Safe{'scratch'}->{'out'} = $b;
           $Safe{'scratch'}->{'out2'} = $c;
           return '';
 [/perl]

tva : 0.196                     ([scratch tva])<BR>
subtotalvar : 2500        ([scratch subtotalvar])<BR>
test :                             ([scratch test])<BR>
out :                              ([scratch out])<BR>
out2 :                              ([scratch out2])<BR>

Joachim

-- 
-------------Hans-Joachim Leidinger---------------------