This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #77496] tied gets scalars and globs confused
[perl5.git] / pp_sys.c
index 78b635f..f47395b 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -941,7 +941,7 @@ PP(pp_tied)
     const char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV)
                ? PERL_MAGIC_tied : PERL_MAGIC_tiedscalar;
 
-    if (isGV_with_GP(sv) && !(sv = MUTABLE_SV(GvIOp(sv))))
+    if (isGV_with_GP(sv) && !SvFAKE(sv) && !(sv = MUTABLE_SV(GvIOp(sv))))
        RETPUSHUNDEF;
 
     if ((mg = SvTIED_mg(sv, how))) {