Help for this page

Select Code to Download


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