I've been wrestling with this problem for almost a week now, trying different options, without any success, unless I use Javascript, but that creates another set of problems.
Anyway, I'm trying to load the %%description%% data from the data file, which looks like this,
Black Blue Yellow Fuschia Purple Green Orange Purple
into an array which I want to parse into a <SELECT> field.
Here's my code:
<!--agorascript-pre
{ local ($str)="";
@arrayOfStrings = split(" ", "%%description%%");
$str .= "1st String=";
$str .= $arrayOfStrings[0];
$str .= "\n";
$str .= "2nd String=";
@arrayOfStrings = qw(%%description%%);
$str .= $arrayOfStrings[0];
$str .= "\n";
return $str;
}
-->
And here's what gets generated. As you can see, I've used 2 different Perl commands both of which are supposed to split a string into an array, and neither work.
1st String=Black Blue Yellow Fuschia Purple Green Orange Purple
2nd String=Black Blue Yellow Fuschia Purple Green Orange Purple
What should get generated is:
1st String=Black
2nd String=Black
Anyone have an idea why this isn't working? I'd appreciate any help.
Bob M