in reply to Re^3: How to completely destroy class attributes with Test::Most?
in thread How to completely destroy class attributes with Test::Most?

Thanks for the extra tips and advice. The code is a work and progress and still kind of crufty. The new constructors, for example, used to have code in them until I figured out how write the code more cleanly. I just haven't bothered to remove them yet.

Regarding underscores, are you saying that because they are *all* internal, there is no need to bother with the convention of using them?

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re^5: How to completely destroy class attributes with Test::Most?
by jcb (Parson) on Aug 26, 2019 at 04:03 UTC

    For instance variables, that is, the keys in the blessed anonymous hash that you are using to store your instance data, a leading underscore more usefully indicates "private from subclasses" since all of an object's implementation is supposed to be encapsulated behind methods. So there is a convention, but it is a different convention from method names, where the leading underscore indicates that a method is not part of the external API.

      OK, I think I got you. So since my chained classes basically all work together to essentially create one object across many classes, there really is not need to flag them as private from one class to another.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks