Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

EXP function in perl

I am trying to use the code below to store seg1 to seg5. This works perfectly when I remove the EXP() from rows 36-39 but as soon as I add this function I get an error "Undefined subroutine &authlib9_11_0::EXP called at (eval 32) line 35, line 16."
Can anyone see any issues with this?
[% Begin Unverified Perl
my $Att1 = VALUE("Q1x3_r1");
my $Att2 = VALUE("Q1x3_r2");
my $Att3 = VALUE("Q1x3_r3");
my $Att4 = VALUE("Q1x3_r4");
my $Att5 = VALUE("Q1x3_r5");
my $Att6 = VALUE("Q1x3_r6");
my $TO1= -5.69416202904785;
my $TO2= -0.815231905439242;
my $TO3= 0.406198710642085;
my $TO4= 1.07521387249431;
my $TO5= -0.689140117260075;
my $TO6= 0.490332060616061;
my $TO7= 0.937197657120568;
my $UN1= -1.73033418521136;
my $UN2= 0.161098360241069;
my $UN3= -0.169952531731027;
my $UN4= 0.56673825488651;
my $UN5= -0.802340829268938;
my $UN6= 1.8671114854458;
my $UN7= -0.538696213409246;
my $FD1= 3.01877334171846;
my $FD2= 1.0090940078586;
my $FD3= -0.349187274385121;
my $FD4= 1.10922744022425;
my $FD5= -0.454590356516203;
my $FD6= 1.87795562482886;
my $FD7= -3.25042814867496;
my $FF1= -1.73033418521136;
my $FF2= 0.161098360241069;
my $FF3= -0.169952531731027;
my $FF4= 0.56673825488651;
my $FF5= -0.802340829268938;
my $FF6= 1.8671114854458;
my $FF7= -0.538696213409246;
my $TOScore = EXP($TO1 + $Att1 * $TO2 + $Att2 * $TO3 + $Att3 * $TO4 + $Att4 * $TO5 + $Att5 * $TO6 + $Att6 * $TO7);
my $UNScore = EXP($UN1 + $Att1 * $UN2 + $Att2 * $UN3 + $Att3 * $UN4 + $Att4 * $UN5 + $Att5 * $UN6 + $Att6 * $UN7);
my $FDScore = EXP($FD1 + $Att1 * $FD2 + $Att2 * $FD3 + $Att3 * $FD4 + $Att4 * $FD5 + $Att5 * $FD6 + $Att6 * $FD7);
my $FFScore = EXP($FF1 + $Att1 * $FF2 + $Att2 * $FF3 + $Att3 * $FF4 + $Att4 * $FF5 + $Att5 * $FF6 + $Att6 * $FF7);
SETVALUE("seg1",$TOScore);
SETVALUE("seg2",1);
SETVALUE("seg3",$UNScore);
SETVALUE("seg4",$FDScore);
SETVALUE("seg5",$FFScore);

End Unverified %]
 
asked Aug 19 by PaulK (250 points)
Paul, given Perl is case sensitive, should "EXP" be "exp"?
Cheers Paul, that's all it was :-)

1 Answer

+1 vote
 
Best answer
Great stuff mate. Good to see it was an easy fix.

Regards Paul.
answered Aug 19 by Paul Moon Platinum (94,725 points)
selected Aug 19 by PaulK
...