in reply to subroutine arguments

The array slurps everithing in the assignment. This is one of the cases in which prototypes may come handy. Check perlsub to learn more about them.
sub cog_class (\@$) { my $name = pop; print "NAME $name\n"; for (@{ $_[0] }) { # Note the Perl-style c<for> loop!! # BLAH BLAH } }
Or else, even avoiding to mess up with prototypes (if you don't really need them), you must extract the single scalar params you want manually.