void foo(SV * sv) { if(sv) { printf("%s\n", SvPV_nolen(sv)); } } void bar(SV * sv) { printf ("%i\n", SvPOK(sv)); } Mytest2::foo('asdf'); # prints asdf Mytest2::bar(1); # prints 0 Mytest2::foo(1); # Segmentation Fault