Index | index by Group | index by Distribution | index by Vendor | index by creation date | index by Name | Mirrors | Help | Search |
Name: perl-Class-Accessor | Distribution: openSUSE Tumbleweed |
Version: 0.510.0 | Vendor: openSUSE |
Release: 1.1 | Build date: Fri Oct 10 17:31:02 2025 |
Group: Unspecified | Build host: reproducible |
Size: 41768 | Source RPM: perl-Class-Accessor-0.510.0-1.1.src.rpm |
Packager: https://bugs.opensuse.org | |
Url: https://metacpan.org/release/Class-Accessor | |
Summary: Automated accessor generation |
This module automagically generates accessors/mutators for your class. Most of the time, writing accessors is an exercise in cutting and pasting. You usually wind up with a series of methods like this: sub name { my $self = shift; if(@_) { $self->{name} = $_[0]; } return $self->{name}; } sub salary { my $self = shift; if(@_) { $self->{salary} = $_[0]; } return $self->{salary}; } One for each piece of data in your object. While some will be unique, doing value checks and special storage tricks, most will simply be exercises in repetition. Not only is it Bad Style to have a bunch of repetitious code, but it's also simply not lazy, which is the real tragedy. If you make your module a subclass of Class::Accessor and declare your accessor fields with mk_accessors() then you'll find yourself with a set of automatically generated accessors which can even be customized! The basic set up is very simple: package Foo; use base qw(Class::Accessor); Foo->mk_accessors( qw(far bar car) ); Done. Foo now has simple far(), bar() and car() accessors defined. Alternatively, if you want to follow Damian's _best practice_ guidelines you can use: package Foo; use base qw(Class::Accessor); Foo->follow_best_practice; Foo->mk_accessors( qw(far bar car) ); *Note:* you must call 'follow_best_practice' before calling 'mk_accessors'.
Artistic-1.0 OR GPL-1.0-or-later
* Fri Oct 10 2025 Tina Müller <tina.mueller@suse.com> - Normalize CPAN version See https://github.com/openSUSE/cpanspec/issues/47 for details * Mon Oct 23 2017 coolo@suse.com - updated to 0.51 see /usr/share/doc/packages/perl-Class-Accessor/Changes 0.50 2017-10-20 Thanks to Jonas B. Nielsen for working through the RT queue. - patch for speed increase RT#84838 - patch for faster constructor RT#57353 - fixed typos for RT#61304 and RT#86422 * Fri Nov 18 2011 coolo@suse.com - use original .tar.gz * Mon Aug 22 2011 lars@linux-schulserver.de - enhance the description - also package examples directory * Tue Nov 30 2010 coolo@novell.com - switch to perl_requires macro * Mon Mar 08 2010 chris@computersalat.de - cleanup spec o dep for perl-macros o Provides o Makefile.PL * Wed Jan 13 2010 anicka@suse.cz - update to 0.34 * add a Moose-like interface: I can haz "has" * Sun Jan 10 2010 jengelh@medozas.de - enable parallel build * Sat Jul 25 2009 chris@computersalat.de - spec mods * removed ^---------- * removed ^#--------- * Sun Jun 28 2009 chris@computersalat.de - added perl-macros o autogen filelist with perl_gen_filelist - spec mods o fixed deps no usage of Carp::Assert since 0.15
/usr/lib/perl5/vendor_perl/5.42.0/Class /usr/lib/perl5/vendor_perl/5.42.0/Class/Accessor /usr/lib/perl5/vendor_perl/5.42.0/Class/Accessor.pm /usr/lib/perl5/vendor_perl/5.42.0/Class/Accessor/Fast.pm /usr/lib/perl5/vendor_perl/5.42.0/Class/Accessor/Faster.pm /usr/share/doc/packages/perl-Class-Accessor /usr/share/doc/packages/perl-Class-Accessor/Changes /usr/share/doc/packages/perl-Class-Accessor/README /usr/share/doc/packages/perl-Class-Accessor/examples /usr/share/doc/packages/perl-Class-Accessor/examples/benchmark /usr/share/man/man3/Class::Accessor.3pm.gz /usr/share/man/man3/Class::Accessor::Fast.3pm.gz /usr/share/man/man3/Class::Accessor::Faster.3pm.gz
Generated by rpm2html 1.8.1
Fabrice Bellet, Tue Oct 21 22:26:35 2025