1accessors::chained(3) User Contributed Perl Documentationaccessors::chained(3)
2
3
4
6 accessors::chained - create method chaining accessors in caller's
7 package.
8
10 package Foo;
11 use accessors::chained qw( foo bar baz );
12
13 my $obj = bless {}, 'Foo';
14
15 # generates chaining accessors:
16 $obj->foo( 'hello ' )
17 ->bar( 'world' )
18 ->baz( "!\n" );
19
20 print $obj->foo, $obj->bar, $obj->baz;
21
23 The accessors::chained pragma lets you create simple method-chaining
24 accessors at compile-time.
25
26 This module exists for future backwards-compatability - if the default
27 style of accessor ever changes, method-chaining accessors will still be
28 available through this pragma.
29
30 See accessors for documentation.
31
33 Steve Purkis <spurkis@cpan.org>
34
36 accessors, accessors::classic, base
37
38
39
40perl v5.12.0 2010-04-29 accessors::chained(3)