ob = MUTABLE_SV(SvRV(sv));
else if (!SvOK(sv)) goto undefined;
else {
+ /* this isn't a reference */
GV* iogv;
STRLEN packlen;
- const char * packname = NULL;
+ const char * const packname = SvPV_nomg_const(sv, packlen);
bool packname_is_utf8 = FALSE;
-
- /* this isn't a reference */
- if(SvOK(sv) && (packname = SvPV_nomg_const(sv, packlen))) {
- const HE* const he =
+ const HE* const he =
(const HE *)hv_common_key_len(
PL_stashcache, packname,
packlen * -(packname_is_utf8 = !!SvUTF8(sv)), 0, NULL, 0
);
- if (he) {
+ if (he) {
stash = INT2PTR(HV*,SvIV(HeVAL(he)));
goto fetch;
- }
}
- if (!SvOK(sv) ||
- !(packname) ||
- !(iogv = gv_fetchpvn_flags(
+ if (!(iogv = gv_fetchpvn_flags(
packname, packlen, SVf_UTF8 * packname_is_utf8, SVt_PVIO
)) ||
!(ob=MUTABLE_SV(GvIO(iogv))))
{
/* this isn't the name of a filehandle either */
- if (!packname || !packlen)
+ if (!packlen)
{
Perl_croak(aTHX_ "Can't call method \"%"SVf"\" "
"without a package or object reference",