in reply to Subroutine Behaviour

You're always passing one item to your subroutine, so scalar @_ is always one. I'm not sure why you expected it to be different.

And a reference to something is always true, and definitely not 0 and very unlikely to be 1, so that's why you end up further down.

Perhaps you should study a bit more about subroutine arguments and things before trying skewy programs?

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.