"Fossies" - the Fresh Open Source Software Archive

Member "install-tl-20200916/tlpkg/tlperl/site/lib/LWP/MemberMixin.pm" (7 Mar 2020, 875 Bytes) of package /windows/misc/install-tl.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 package LWP::MemberMixin;
    2 
    3 our $VERSION = '6.43';
    4 
    5 sub _elem {
    6     my $self = shift;
    7     my $elem = shift;
    8     my $old  = $self->{$elem};
    9     $self->{$elem} = shift if @_;
   10     return $old;
   11 }
   12 
   13 1;
   14 
   15 __END__
   16 
   17 =pod
   18 
   19 =head1 NAME
   20 
   21 LWP::MemberMixin - Member access mixin class
   22 
   23 =head1 SYNOPSIS
   24 
   25  package Foo;
   26  use base qw(LWP::MemberMixin);
   27 
   28 =head1 DESCRIPTION
   29 
   30 A mixin class to get methods that provide easy access to member
   31 variables in the C<%$self>.
   32 Ideally there should be better Perl language support for this.
   33 
   34 =head1 METHODS
   35 
   36 There is only one method provided:
   37 
   38 =head2 _elem
   39 
   40     _elem($elem [, $val])
   41 
   42 Internal method to get/set the value of member variable
   43 C<$elem>. If C<$val> is present it is used as the new value
   44 for the member variable.  If it is not present the current
   45 value is not touched. In both cases the previous value of
   46 the member variable is returned.
   47 
   48 =cut