accessors::rw(3pm)

accessors::rw3pm

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

Usage

  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" );

Overview

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

Releases

7 releases since Debian 7 (Wheezy); the text changed 3 times.

  1. 7–8
  2. 9–10
  3. 11
  4. 12–13

Author

Steve Purkis <[email protected]>.

From libaccessors-perl 1.01-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.