Perl Array Return Problem


I am trying to use the perl scripting node in Knime 2.5.2 to process some text. However, I am having some trouble returning an array of strings. The simplest example I can find is the following:

@array = ("foo","bar");

return @array; 

I get the following error message:

ERROR Perl Scripting Execute failed: Runtime class of object "2" (index 0) in row "Row1" is StringCell and does not comply with its supposed superclass ListCell (Collection of: StringCell)

I have seen that in a previous release note that a bug related to array return in the perl node was solved so maybe I am doing a really silly mistake blush but I can't find the way to solve it. Could someone help me?

Thanks in advance,


OK, one of my colleagues help me out.

I will leave the solution here in case any perl rookie gets into trouble.

Solution 1: return just the reference to the array

return \@array; 

Solution 2: create a reference to an anonymous array

$array = ["foo","bar"];

return $array;