my @c; for (my $i = 0; $i < length; $i++) { for (my $j = 2; $i + $j <= length; $j++) { push @c, substr $_, $i, $j; } } #### Attempt to free unreferenced scalar: SV 0x9730848, Perl interpreter: 0x970a008 at /tmp/perm2 line 17, line 1.