I did consider to do that, but, as development is not fully done, I decided not to.

Nevertheless I will supply you with the POD - which should be more of a reference to a propper name, then the code itself (right?)

NAME
Class::AccessorMaker generate common accessor method with default values.
SYNOPSIS
With constructor package Users; use Class::AccessorMaker { username => "guest", password => "", role => "guest", groups => [ "guest" ] }; package main; my $usr = Users->new(username => $uname, password => $pw); With init constructor package MailThing; use Class::AccessorMaker { to => "", from => "hartog\@2organize.com", cc => "", bcc => "", bounce => "" }, "new_init"; sub init { my ($self) = @_; ... } package main; my $mlr = MailThing->new(); Without constructor package HitMan; use Class::AccessorMaker { victim => "", location => "", data => {} }, "no_new"; sub new { my $class = ref($_[0]) or $_[0]; shift; return bless({}, $class); } package main; Of course the first example describes some sort of user system, which assumes you are a guest by default. The second example is some sort of mailer-object. And the third is used by a lot of serial killers out there...
DESCRIPTION
The AccesorMaker takes in, at use-time, a hash-reference and an extra keyword. It uses the keys of the hash-reference to create accessor-methods in the namespace of the caller. The values that are given to the keys are the default value of the accessor. Class::AccessorMaker will create a constructor (called "new()") by default. This constructor will be able to take that nice and shiny hash-like structure as you can see in the first example. If you want your constructor to run your objects "init()" routine you can specify the keyword "new_init". If you want to write your own "new()" routine you can use "no_new".
NOW HERE THIS
This module is still under some sort of development, and I am expecting to release things like ReadOnly / WriteOnce accessor methods in the near future. I alredy have Class::AccessorMaker::Private out there for you, which could prove to be very usefull for you.
PITFALLS
Please do not put those perl-reserved names in there like DESTROY, import, AUTOLOAD, and so on. It will hurt you badly. Q: "But why do you not filter those?" A: "This is perl baby, you can do whatever you like..." And besides, there is going to be someone out there who is actualy going to put it to good use...
AUTHOR
Hartog 'Sinister' de Mik <hartog@2organize.com>


Any good for you?

er formait hyarya.
-- "Life is a house and the next tornado is never far away"
-- "lovely by nature"


In reply to Re: Re: What namespace?? by Sinister
in thread What namespace?? by Sinister

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.