in reply to Odd behavior of non-array symbolic references with $# (was : array)

Whether intentionally or not, you are using symbolic references. That is usually a bad idea, at least, as a certain monk will repeat, until and unless you know why it is (most often) a bad idea.

What you are accessing is really $#+, which is the last index of @+, which perlvar says "holds the offsets of the ends of the last successful submatches in the currently active dynamic scope".

... which implies that this particular case will bite you only if there has been a successful match (with or without capturing braces, since the entire match is the 0th submatch) in the "currently active dynamic scope".

I don't even want to know what the "currently active dynamic scope" is, and there are plenty other arrays always present, so I would try to rewrite that code not to use symbolic references. Try hashes, perhaps?

The Sidhekin
print "Just another Perl ${\(trickster and hacker)},"