in reply to Re^4: what does the retval of can() do ?
in thread what does the retval of can() do ?

I suggest something more like:

$a->$b() if defined $b;

... but whether your code is correct really depends on the implementation of the test() method. I usually see code that just checks whether can() returns a true value.