in reply to Perl ARRAY() result

Hi, Perl provides strictures and warnings to point out problems with your code. If you had enabled them you would have been pointed to the source of your problem immediately. See Basic debugging checklist Item 1.

After adding

use strict; use warnings;
to your code, I ran it and got this output:
Can't use an undefined value as an ARRAY reference at 1228495.pl line +24.
... the offending line being, as others have pointed out,
print "@$_\n", [ @$included, $nextValue ]
As your case ably illustrates, it's just downright foolish to run your code without strictures!

Hope this helps.


The way forward always starts with a minimal test.