* beginning." --Gandalf, relating Gollum's story
*/
+/* This file contains the code that implements the functions in Perl's
+ * UNIVERSAL package, such as UNIVERSAL->can().
+ */
+
#include "EXTERN.h"
#define PERL_IN_UNIVERSAL_C
#include "perl.h"
vnumify(req),vnormal(req),vnumify(sv),vnormal(sv));
}
- if (sv == (SV*)&PL_sv_undef) {
- ST(0) = sv;
- } else {
+ if ( SvOK(sv) && sv_derived_from(sv, "version") ) {
ST(0) = vnumify(sv);
+ } else {
+ ST(0) = sv;
}
XSRETURN(1);