source: main/trunk/greenstone2/perllib/cpan/LWP/MemberMixin.pm@ 27183

Last change on this file since 27183 was 27183, checked in by davidb, 11 years ago

Changing to using installed version of LWP that comes from libwww-perl, which is more self-contained than v6.x

File size: 846 bytes
Line 
1package LWP::MemberMixin;
2
3sub _elem
4{
5 my $self = shift;
6 my $elem = shift;
7 my $old = $self->{$elem};
8 $self->{$elem} = shift if @_;
9 return $old;
10}
11
121;
13
14__END__
15
16=head1 NAME
17
18LWP::MemberMixin - Member access mixin class
19
20=head1 SYNOPSIS
21
22 package Foo;
23 require LWP::MemberMixin;
24 @ISA=qw(LWP::MemberMixin);
25
26=head1 DESCRIPTION
27
28A mixin class to get methods that provide easy access to member
29variables in the %$self.
30Ideally there should be better Perl language support for this.
31
32There is only one method provided:
33
34=over 4
35
36=item _elem($elem [, $val])
37
38Internal method to get/set the value of member variable
39C<$elem>. If C<$val> is present it is used as the new value
40for the member variable. If it is not present the current
41value is not touched. In both cases the previous value of
42the member variable is returned.
43
44=back
Note: See TracBrowser for help on using the repository browser.