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


NAME

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

Back to Top


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

Back to Top


DESCRIPTION

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

Back to Top


AUTHOR

Steve Purkis <spurkis@cpan.org>.

Back to Top


SEE ALSO

the accessors manpage, the accessors::ro manpage, the accessors::classic manpage, the accessors::chained manpage, base

Back to Top

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