Gabor Szabo wrote: > >> $x{foo} ||= 1; > > I have not tested you recent patch. That might have solved this one > too as this is very similar. > > $a = func() || croak("we have some problem");
Actually, that's quite different. > According to Devel::Cover the above statetement has 3 states. One of > them, when croak returns 1 will never happen as croak never returns. But Devel::Cover can't know that. It doesn't know what (or if) an arbitrary function will return. Besides, who says that this is Carp::croak() and not (e.g.) Frog::croak() that might do something entirely different? In '$x ||= 1' it's apparent that the RHS is a constant. In '$x ||= []' (something Paul's already heard about ;) the RHS isn't a constant, but it is always boolean true. In '$x ||= func()', func() could do anything. I think that Devel::Cover has to treat this as a "3 state or". If you don't get full coverage, you'll have to analyze the code to determine whether that's correct or you've missed something. Full coverage isn't always possible, and the lack of it isn't necessarily a problem. If Devel::Cover can identify the first two as a "2 state or", I'm happy. -mjc