I believe that SUPER:: isn't going to work because that would be trying to call the password method from whatever your class is inheriting from. ie: Class::DBI. (not 100% positive on that). Since the password method is going to exist in your current package, you are overwriting it and SUPER:: will not work.

CDBI uses Class::Accessor to handle the accessor/mutator creation. When it creates an accessor it creates an alias to it called _WHATEVER_accessor. So you can do this instead:

return $self->_password_accessor(@_)

However that this will not work when using create or find_or_create. Only for modification. I would go for the trigger option instead. If you are going to use triggers you can use before_create and before_set_password.

The one other method you can do is create a class for the passwords, and then set a has_a relationship for the password column. Since this is a fairly simple task, that may be overkill. But it is something to think about.

-Brad

In reply to Re: (z) SUPER and Class::DBI by duct_tape
in thread (z) SUPER and Class::DBI by zigdon

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.