BrowserUK,
Thanks, but it does not work I tried to remove the line from the BEGIN block and I also completely removed the block. Either option did not make a difference to the error message.
The actual benchmark script coming with this package is running fine in my environment and I cannot spot my error. The current code - which still produces the above quoted error is:
package Variant; use strict; use warnings; use Exporter; use Class::Accessor; our ( @EXPORT, @EXPORT_OK, %EXPORT_TAGS ); @EXPORT = qw(); %EXPORT_TAGS= (); @EXPORT_OK = qw(); use base ( qw(Exporter Class::Accessor) ); our ( $VERSION, $LAST_ERROR ); __PACKAGE__->mk_accessor( qw(name nodes) );
I have noticed, that the benchmark example as well as the examples in the documentation use either a base class with all fields defined or Class::Fields as base class. I intend - and only then does using Class:Accessor make sense to me to include it in a base class that does not yet know which fields are in my derived classes. Are there any issues with this setup? Do I need to define the fields of my class before calling mk_accessor( @fieldnames )

Cheers,
PerlingTheUK

In reply to Re^2: Class::Accessor Problem by PerlingTheUK
in thread Class::Accessor Problem by PerlingTheUK

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.