This doesn't actually change anything as the constant is still
usable in other subroutines, but helps with consistency and
readability IMHO.
$dbh->last_insert_id(undef, undef, 'msgmap', 'num');
}
$dbh->last_insert_id(undef, undef, 'msgmap', 'num');
}
-use constant MID_FOR => 'SELECT mid FROM msgmap WHERE num = ? LIMIT 1';
sub mid_for {
my ($self, $num) = @_;
my $dbh = $self->{dbh};
sub mid_for {
my ($self, $num) = @_;
my $dbh = $self->{dbh};
+ use constant MID_FOR => 'SELECT mid FROM msgmap WHERE num = ? LIMIT 1';
my $sth = $self->{mid_for} ||= $dbh->prepare(MID_FOR);
$sth->bind_param(1, $num);
$sth->execute;
my $sth = $self->{mid_for} ||= $dbh->prepare(MID_FOR);
$sth->bind_param(1, $num);
$sth->execute;