I have a Moose class which represents websites on a server, call it the Website class. This is a parent class of two subclasses: Website::Drupal and Website::WordPress. Website objects start out as a generic. Once the object "learns" which type of object it is, I'd like it to subclass itself as Website::WordPress or Website::Drupal. I believe that "coercion" is what I need to do. I read this but I couldn't really make heads or tails of it and so I'm not sure if I'm on the right track. If someone could give me some hints to steer me in the right direction, I'd appreciate it.
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Converting Moose object to a subclass of itself by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |