if( $thing->can('id') ) { say "Object ID is ", $thing->id; } else { say "Object has no unique ID"; }
Can't call method "can" on an undefined value
if( $thing->can('id') ) { say "Object ID is ", $thing->id; } else { say "Object has no unique ID"; }
Can't call method "can" on an undefined value