# Perl Array Return Problem

**URL:** <https://forum.knime.com/t/perl-array-return-problem/1787>\
**Category:** KNIME Extensions\
**Tags:** labs\
**Created:** [March 1, 2012, 3:49pm UTC](https://forum.knime.com/t/perl-array-return-problem/1787 "2012-03-01T15:49:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luis.defigueiredo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/a8b319/32.png) [@luis.defigueiredo](https://forum.knime.com/u/luis.defigueiredo)\
**Post date:** [March 1, 2012, 3:49pm UTC](https://forum.knime.com/t/perl-array-return-problem/1787/1 "2012-03-01T15:49:30Z")

</div>

Hi,

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;&nbsp;

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](https://forum-cdn.knime.com/sites/all/libraries/ckeditor/plugins/smiley/images/embaressed_smile.gif "blush")&nbsp;but I can't find the way to solve it. Could someone help me?

Thanks in advance,

Luis

---

<div class="post-metadata">

**Author:** ![luis.defigueiredo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/a8b319/32.png) [@luis.defigueiredo](https://forum.knime.com/u/luis.defigueiredo)\
**Post date:** [March 1, 2012, 4:32pm UTC](https://forum.knime.com/t/perl-array-return-problem/1787/2 "2012-03-01T16:32:42Z")

</div>

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;&nbsp;

Solution 2: create a reference to an anonymous array

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

return $array;&nbsp;

Cheers,

Luis

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:16pm UTC](https://forum.knime.com/t/perl-array-return-problem/1787/3 "2023-06-23T20:16:55Z")

</div>


