Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Class::Struct accessor function after Perl V5.16

by tobyink (Canon)
on Jan 02, 2019 at 11:31 UTC ( [id://1227913]=note: print w/replies, xml ) Need Help??


in reply to Class::Struct accessor function after Perl V5.16

Doing a diff on the Class::Struct included with Perl 5.14 (I don't have 5.16 on my system) and 5.26, it does look like the constructor was changed from doing direct assignment of initial values into the blessed hashref to instead calling the object's accessors to assign initial values. It doesn't look like there's any way to have this work consistently between the versions, short of writing your own constructor, and then you miss out on most of the benefits of using Class::Struct to begin with.

Personally, I'd recommend switching to using one of the better supported OO toolkits on CPAN: Class::Tiny, Moo, or Moose.

  • Comment on Re: Class::Struct accessor function after Perl V5.16

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-25 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found