in reply to First Perl Module!!

The class name noted before the -> operator is actually passed as the first argument to your subroutine. Other languages hide this fact from you (such as Java's this), but Perl doesn't.

To fix it, you need to change the subroutine to something like this:

sub test{ my $class = shift; my $name = shift; return $name; }

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated