Hi Monks,
Is there ever a difference in semantics between
sub foo {
....
my $value = <expression>;
return $value;
}
and
sub foo {
....
return <expression>;
}
?
I ask this because I am experiencing a negative interaction between the Komodo remote debugger and the CPAN module DBIx::transaction. When debugging code that commits a transaction, I get an error like this:
panic: attempt to copy freed scalar 350d010 to 15c7b68 at /usr/share/komodo/perllib/perl5db.pl line 4341, <STDIN> line 1.
Strangely, I have found that I can fix the error by changing the definition of close_transaction in DBIx/Transaction/db.pm from
sub close_transaction {
my $self = shift;
my $method = shift;
my $code = DBI::db->can($method);
$self->{private_DBIx_Transaction_Level} = 0;
$self->clear_transaction_error;
$self->transaction_trace($method);
my $rv = $code->($self, @_);
return $rv;
}
to
sub close_transaction {
my $self = shift;
my $method = shift;
my $code = DBI::db->can($method);
$self->{private_DBIx_Transaction_Level} = 0;
$self->clear_transaction_error;
$self->transaction_trace($method);
return $code->($self, @_);
}
to me, it looks like my change should have no effect, and yet it eliminates the panic. What's going on here? Could it be a bug in the Komodo remote debugging libraries, or in the Perl implementation, or in DBIx::Transaction?
In reply to Attempt to copy freed scalar and return value semantics by turkanis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |