- or download this
if( ! ref($r) ) {
# no reference at all
} elsif( ! UNIVERSAL::can($r,'can') ) {
...
} else {
# blessed ref
}
- or download this
if( ref($r) && UNIVERSAL::can($r,'can') ) {
# blessed ref
}
- or download this
if( ref($r) && eval { $r->can('can') } ) {
# blessed ref
}