in reply to Why this problem in MethodMaker ?

my ($self,$val1,$val2) = shift;

You mean @_, not shift.

Replies are listed 'Best First'.
Re^2: Why this problem in MethodMaker ?
by vishi83 (Pilgrim) on Oct 25, 2005 at 06:42 UTC
    Hi chromatic !

    Giving my($self, $val1, $val2) = @_ ; within a method inside Methodmaker is not working.. In the same context, Any method that takes two arguments can't be defined inside MethodMaker unless , otherwise we use array or an hash.. Why is that so ?? For example i hav a method called 'save' defined inside a MethodMaker and when i called this method like this ...

    $object->save($name,$id);
    Value of name is alone returned and id's value is null...

    Thanks Vishi