Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Class::Accessor Problem

by PerlingTheUK (Hermit)
on Nov 27, 2005 at 16:52 UTC ( [id://512030]=note: print w/replies, xml ) Need Help??


in reply to Re: Class::Accessor Problem
in thread Class::Accessor Problem

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://512030]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-28 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found