7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package YourClass;
[... use strict etc ...]]
our @ISA = qw(DBI);
[... andere Methoden ...]
sub prepare{
my ($self,@params) = @_;
my $sth = SUPER::prepare(@params);
my $nr = ++$self->{nr};
push(@{$self->{sth}},$sth);
my $tmpObj = HelperClass->new($self,$sth,$nr);
return $tmpObj;
}
sub execute{
my ($self,$nr,@params) = @_;
[... logging ...]
$self->{sth}->[$nr]->execute(@params);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
package HelperClass;
sub new{
my ($class,$parent,$nr) = @_;
my $self = {};
bless $self,$class;
$self->{parent} = $parent;
$self->{nr} = $nr;
}
sub execute{
my ($self,@params) = @_;
$self->{parent}->execute($nr,@params);
}
7 Einträge, 1 Seite |