X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FStatistics.pm;h=3b9d7d6af325e09e3cbb518b278d16387ea49ceb;hb=1b7fb46ef19b1c77f22a3054b074fa5d5dc3ac5e;hp=eaa3ee9d19e46e8cecba4245e6ca347ece0a8bca;hpb=04786a4c19fe3964002b69e8a3dbb291524e0610;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/Statistics.pm b/lib/DBIx/Class/Storage/Statistics.pm index eaa3ee9..3b9d7d6 100644 --- a/lib/DBIx/Class/Storage/Statistics.pm +++ b/lib/DBIx/Class/Storage/Statistics.pm @@ -30,10 +30,10 @@ Returns a new L object. =cut sub new { - my $self = {}; - bless $self, (ref($_[0]) || $_[0]); + my $self = {}; + bless $self, (ref($_[0]) || $_[0]); - return $self; + return $self; } =head2 debugfh @@ -49,9 +49,9 @@ Called when a transaction begins. =cut sub txn_begin { - my $self = shift(); + my $self = shift; - $self->debugfh->print("BEGIN WORK\n"); + $self->debugfh->print("BEGIN WORK\n"); } =head2 txn_rollback @@ -60,9 +60,9 @@ Called when a transaction is rolled back. =cut sub txn_rollback { - my $self = shift(); + my $self = shift; - $self->debugfh->print("ROLLBACK\n"); + $self->debugfh->print("ROLLBACK\n"); } =head2 txn_commit @@ -71,9 +71,9 @@ Called when a transaction is committed. =cut sub txn_commit { - my $self = shift(); + my $self = shift; - $self->debugfh->print("COMMIT\n"); + $self->debugfh->print("COMMIT\n"); } =head2 query_start @@ -83,17 +83,17 @@ executed and subsequent arguments are the parameters used for the query. =cut sub query_start { - my ($self, $string, @bind) = @_; + my ($self, $string, @bind) = @_; - my $message = "$string: ".join(', ', @bind)."\n"; + my $message = "$string: ".join(', ', @bind)."\n"; - if(defined($self->callback())) { - $string =~ m/^(\w+)/; - $self->callback()->($1, $message); - return; - } + if(defined($self->callback)) { + $string =~ m/^(\w+)/; + $self->callback->($1, $message); + return; + } - $self->debugfh->print($message); + $self->debugfh->print($message); } =head2 query_end @@ -102,8 +102,7 @@ Called when a query finishes executing. Has the same arguments as query_start. =cut sub query_end { - my $self = shift(); - my $string = shift(); + my ($self, $string) = @_; } 1;