in reply to Is it a list or a flip-flop?

I'm not sure where the (or flip) comes from, but the problem is that the code is trying to assign a list to a scalar. Here are versions that work:

use warnings; use strict; my $n = 9; my $listRef = [(1..$n)]; # Assign array reference my @list = (1..$n); # Assign to an array

Perl is Huffman encoded by design.