in reply to Issue with creating module

You're calling return_two_values() as a method, so the first argument is the object. Your code should read:

my ($self, $val1, $val2) = @_;

The $self variable here is a reference to your $new_module object.

Also, it's worth noting that your choice of variable name for your object reference isn't the best. The module here is "Learning" but the variable $new_module actually holds an object not a module. You might call this variable $new_object instead, to keep things clearer in your mind.

-sam

Replies are listed 'Best First'.
Re^2: Issue with creating module
by Anonymous Monk on Mar 12, 2008 at 19:29 UTC
    Thanks sam...I still have a lot to learn :)