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


accessors documentation  | view source Contained in the accessors distribution.

Index


NAME

Top

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

SYNOPSIS

Top

  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

Top

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

AUTHOR

Top

Steve Purkis <spurkis@cpan.org>.

SEE ALSO

Top

accessors, accessors::ro, accessors::classic, accessors::chained, base


accessors documentation  | view source Contained in the accessors distribution.