Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    ...
    print test($coderef, "Foo::bar"), "\n"; # 1
    print test($coderef, "Foo::Bar"), "\n"; # 0
    print test($null, "Foo::Bar"), "\n"; # dies appropriately
    
  2. or download this
    SV * test (SV * x, char * name) {
         if((CV*)SvRV(x) == get_cv(name, 0)) return newSVuv(1);
         return newSVuv(0);
    }
    
  3. or download this
    SV * foo1(SV * x) {
         return newSVpv(HvNAME(CvSTASH((CV*)SvRV(x))), 0);
    }