M
Marc Girod
Hello,
Debugging session:
main:
blib/script/synctree:319): exit $rc unless $sync->get_addhash
|| $sync->get_modhash
main:
blib/script/synctree:320): || $sync-
0 '/view/emagiro_t7/vobs/atcctest/foo/d'
DB<3> f SyncTree.pm
....
DB<4> b 224
DB<5> c
ClearCase::SyncTree::_lsco(/vobs/atcctest/ClearCase-SyncTree/blib/lib/
ClearCase/SyncTree.pm:224):
224: return sort keys %co;
DB<5> x %co
0 '/view/emagiro_t7/vobs/atcctest/foo/d'
1 1
DB<6> r
scalar context return from ClearCase::SyncTree::_lsco: undef
ClearCase::Argv:
ESTROY(/home/emagiro/perl/lib/ClearCase/Argv.pm:
852):
852: my $self = shift;
I am under the debugger, there is a list value being returned, I press
'r', and the next line is:
scalar context return ...: undef !!!?
In between there was one object being destroyed:
sub DESTROY {
my $self = shift;
my $ret = $?;
$self->ipc(0) if $self->ipc;
$? |= $ret;
}
....but how could it affect the return value of the function?
I failed to reproduce the problem in a narrow snippet:
#!/vobs/cello/cade_struct/bin/perl -w
use strict;
{
package DBG;
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
sub crap {
return qw(1 2 3);
}
sub DESTROY {
my $self = shift;
my $ret = $?;
system('/bin/date');
$? |= $ret;
}
1;
}
sub fun {
my $thing = DBG->new;
return $thing->crap;
}
print "Fun ", join(' ', fun), "\n";
exit 0 unless fun;
print "End\n";
This does print 'End'...
I am sure I took my brains when I left home this morning...
Marc
Debugging session:
main:
|| $sync->get_modhash
main:
DB<2> x $sync->_lscoget_sublist || $sync->_lsco;
0 '/view/emagiro_t7/vobs/atcctest/foo/d'
DB<3> f SyncTree.pm
....
DB<4> b 224
DB<5> c
ClearCase::SyncTree::_lsco(/vobs/atcctest/ClearCase-SyncTree/blib/lib/
ClearCase/SyncTree.pm:224):
224: return sort keys %co;
DB<5> x %co
0 '/view/emagiro_t7/vobs/atcctest/foo/d'
1 1
DB<6> r
scalar context return from ClearCase::SyncTree::_lsco: undef
ClearCase::Argv:
852):
852: my $self = shift;
I am under the debugger, there is a list value being returned, I press
'r', and the next line is:
scalar context return ...: undef !!!?
In between there was one object being destroyed:
sub DESTROY {
my $self = shift;
my $ret = $?;
$self->ipc(0) if $self->ipc;
$? |= $ret;
}
....but how could it affect the return value of the function?
I failed to reproduce the problem in a narrow snippet:
#!/vobs/cello/cade_struct/bin/perl -w
use strict;
{
package DBG;
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
sub crap {
return qw(1 2 3);
}
sub DESTROY {
my $self = shift;
my $ret = $?;
system('/bin/date');
$? |= $ret;
}
1;
}
sub fun {
my $thing = DBG->new;
return $thing->crap;
}
print "Fun ", join(' ', fun), "\n";
exit 0 unless fun;
print "End\n";
This does print 'End'...
I am sure I took my brains when I left home this morning...
Marc