From: Nicholas Clark Date: Fri, 20 Nov 2009 10:23:54 +0000 (+0000) Subject: Always bless filehandles into IO::Handle:: - don't try for FileHandle:: first. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=31c9a3ace4f559b79a21319b8903e92f53b44868;p=p5sagit%2Fp5-mst-13.2.git Always bless filehandles into IO::Handle:: - don't try for FileHandle:: first. Given that FileHandle "is now a front-end to the IO::* classes" it seems wasted effort to indirect through it. --- diff --git a/sv.c b/sv.c index 45248db..397de23 100644 --- a/sv.c +++ b/sv.c @@ -1431,17 +1431,13 @@ Perl_sv_upgrade(pTHX_ register SV *const sv, svtype new_type) if (new_type == SVt_PVIO) { IO * const io = MUTABLE_IO(sv); - GV *iogv = gv_fetchpvs("FileHandle::", 0, SVt_PVHV); + GV *iogv = gv_fetchpvs("IO::Handle::", GV_ADD, SVt_PVHV); SvOBJECT_on(io); /* Clear the stashcache because a new IO could overrule a package name */ hv_clear(PL_stashcache); - /* unless exists($main::{FileHandle}) and - defined(%main::FileHandle::) */ - if (!(iogv && GvHV(iogv) && HvARRAY(GvHV(iogv)))) - iogv = gv_fetchpvs("IO::Handle::", GV_ADD, SVt_PVHV); SvSTASH_set(io, MUTABLE_HV(SvREFCNT_inc(GvHV(iogv)))); IoPAGE_LEN(sv) = 60; }