SIMPLE SOLUTIONS

ACCESSORS::RW(3PM) - Linux man page online | Library functions

Create 'classic' read/write accessor methods in caller's package.

Chapter
2015-06-07
accessors::rw(3pm) User Contributed Perl Documentation accessors::rw(3pm)

NAME

accessors::rw - create 'classic' read/write accessor methods in caller's package.

SYNOPSIS

package Foo; use accessors::rw qw( foo bar baz ); my $obj = bless {}, 'Foo'; # always return the current value, even on set: $obj->foo( 'hello ' ) if $obj->bar( 'world' ) eq 'world'; print $obj->foo, $obj->bar, $obj->baz( "!\n" );

DESCRIPTION

The accessors::rw pragma lets you create simple classic read/write accessors at compile- time. It is an alias for accessors::classic.

AUTHOR

Steve Purkis <@cpan.org>.

SEE ALSO

accessors, accessors::ro, accessors::classic, accessors::chained, base
perl v5.20.2 2015-06-07 accessors::rw(3pm)
Download raw manual
Main page User Contributed Perl Documentation (+23303) perl v5.20.2 (+3124) № 3 (+68044)
Go top