← Index
NYTProf Performance Profile   « block view • line view • sub view »
For ddd2.pl
  Run on Tue May 25 16:52:24 2010
Reported on Tue May 25 16:56:46 2010

File /project/perl/lib/LWP/MemberMixin.pm
Statements Executed 4611
Statement Execution Time 30.6ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
9222128.5ms28.5msLWP::MemberMixin::::_elemLWP::MemberMixin::_elem
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package LWP::MemberMixin;
2
3# $Id: MemberMixin.pm,v 1.8 2004/04/09 15:07:04 gisle Exp $
4
5sub _elem
6
# spent 28.5ms within LWP::MemberMixin::_elem which was called 922 times, avg 31µs/call: # 461 times (15.4ms+0s) by LWP::UserAgent::protocols_allowed at line 520 of LWP/UserAgent.pm, avg 33µs/call # 461 times (13.1ms+0s) by LWP::UserAgent::protocols_forbidden at line 521 of LWP/UserAgent.pm, avg 28µs/call
{
7461030.6ms my $self = shift;
8 my $elem = shift;
9 my $old = $self->{$elem};
10 $self->{$elem} = shift if @_;
11 return $old;
12}
13
14112µs1;
15
16__END__
17
18=head1 NAME
19
20LWP::MemberMixin - Member access mixin class
21
22=head1 SYNOPSIS
23
24 package Foo;
25 require LWP::MemberMixin;
26 @ISA=qw(LWP::MemberMixin);
27
28=head1 DESCRIPTION
29
30A mixin class to get methods that provide easy access to member
31variables in the %$self.
32Ideally there should be better Perl language support for this.
33
34There is only one method provided:
35
36=over 4
37
38=item _elem($elem [, $val])
39
40Internal method to get/set the value of member variable
41C<$elem>. If C<$val> is present it is used as the new value
42for the member variable. If it is not present the current
43value is not touched. In both cases the previous value of
44the member variable is returned.
45
46=back