Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^6: Class::Accessor attributes

by perldiverx (Sexton)
on Mar 07, 2014 at 14:18 UTC ( #1077392=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Class::Accessor attributes
in thread Class::Accessor attributes

From what I understand it should load the transaction_type class. But, when I do not include this, I get an error stating 'Can't locate object method "_mk_accessors" via package "Monro::CC" at C:/Perl/lib/Class/Accessor.pm line 36.' When I originally came across this error I consulted the documentation for Class::Accessor, and in the 'Moose!' subsection it says you should use extends instead of changing @ISA directly. Why this is: I have no idea, but it does result in not getting the aforementioned error message.


Comment on Re^6: Class::Accessor attributes
Select or Download Code
Re^7: Class::Accessor attributes
by perldiverx (Sexton) on Mar 07, 2014 at 15:03 UTC

    Okay, I think I got this...

    What I did was remove all of the extends and all of the Exporter stuff altogether. New code:

    package Monro::CC; use strict; use warnings; use Class::Accessor "antlers"; has 'transaction_type' => ( is => 'rw', );

    And the script:

    #!/usr/bin/perl use strict; use warnings; use Monro::CC; my $trans_obj = Monro::CC->new({ 'transaction_type' => $transaction_info[0], });

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-07-30 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls