Mainframe2007 has asked for the wisdom of the Perl Monks concerning the following question:

Hi I'm trying to make a dynamic class via the Class:MethodMake module:
#!/usr/bin/perl use Data::Dumper; $m = MyClass->new(); $m->name("theo"); $m->id(1); exit; package MyClass; @fields = qw(id name); use Class::MethodMaker get_set => [ @fields ], new => "new";
But it always results in: Can't locate object method "name" via package "MyClass" at ./myclass.pl line 7.

Replies are listed 'Best First'.
Re: Class::MethodMaker dynamic fields
by zwon (Abbot) on Dec 29, 2011 at 15:29 UTC