Revision 6fd01c3d
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DB/Object.pm | ||
---|---|---|
79 | 79 |
return $self; |
80 | 80 |
} |
81 | 81 |
|
82 |
sub call_sub { |
|
83 |
my $self = shift; |
|
84 |
my $sub = shift; |
|
85 |
return $self->$sub(@_); |
|
86 |
} |
|
87 |
|
|
82 | 88 |
1; |
83 | 89 |
|
84 | 90 |
__END__ |
... | ... | |
132 | 138 |
on. Can be used from methods in this package for getting the actual |
133 | 139 |
object's manager. |
134 | 140 |
|
141 |
=item C<call_sub $name, @args> |
|
142 |
|
|
143 |
Calls the sub C<$name> on C<$self> with the arguments C<@args> and |
|
144 |
returns its result. This is meant for situations in which the sub's |
|
145 |
name is a composite, e.g. |
|
146 |
|
|
147 |
my $chart_id = $buchungsgruppe->call_sub(($is_sales ? "income" : "expense") . "_accno_id_${taxzone_id}"); |
|
148 |
|
|
135 | 149 |
=back |
136 | 150 |
|
137 | 151 |
=head1 AUTHOR |
Auch abrufbar als: Unified diff
Helferfunktion zum Aufruf von Subs mit zusammengesetztem Namen
Conflicts: