I'm doing OOP Perl, and I am growing tired of the following code:
sub set_main_message { $_[0]->{main_message} = $_[1]; } + sub get_main_message { return $_[0]->{main_message}; }
There are different approaches to providing this sort of functionality, in more concise ways (and with extra side benefits). One obvious approach is the "fields/metadata" approach where I make a little object. Could someone give me an overview of the different CPAN modules that solve this and pros/cons? I'm leaning toward something simple.
In reply to "Fields" for "Objects" by zerohero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |