I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2005-11-29 18:23:36-08 by jdhedden
Object::InsideOut v1.15 - Dynamic field creation
Normally, object fields are declared as part of the class's code. However, some classes may require the creation of additionaly object fields as the application runs, especially in conjunction with :Automethods. This release of Object::InsideOut provides a class method that allows class code to dynamically create object fields. Here's an elaborate example used in conjunction with :Automethod
package My::Class; { use Object::InsideOut; sub auto :Automethod { my $self = $_[0]; my $class = ref($self) || $self; my $method = $_; # Extract desired field name from get_/set_ method name my ($fld_name) = $method =~ /^[gs]et_(.*)$/; if (! $fld_name) { return; # Not a recognized method } # Create the field and its standard accessors Object::InsideOut->create_field($class, '@'.$fld_name, "'Standard'=>'$fld_name'"); # Return code ref for newly created accessor no strict 'refs'; return *{$class.'::'.$method}{'CODE'}; } }
Direct Responses: Write a response