diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-10-24 18:14:47 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-24 18:30:13 -0700 |
commit | 8752206e276cffe588c0932b5a9f2331640e8447 (patch) | |
tree | 94e3836449668d2f23dde015d2bc662a39f9108d /t/op | |
parent | 19b96a2b521beb3b36fd375c46258d57d7d8a31e (diff) | |
download | perl-8752206e276cffe588c0932b5a9f2331640e8447.tar.gz |
[perl #77496] tied gets scalars and globs confused
Make pp_tied use the SvFAKE flag to distinguish between tied scalars
and tied handles. This is now possible as of change 2acc3314.
This fixes the problem of tied($scalar) ignoring the tie if the last
thing returned or assigned happened to be a glob.
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/tie.t | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/op/tie.t b/t/op/tie.t index 6e52a6e043..a9fb89e92a 100644 --- a/t/op/tie.t +++ b/t/op/tie.t @@ -939,3 +939,17 @@ sub IO::File::TIEARRAY { fileno FOO; tie @a, "FOO" EXPECT Can't locate object method "TIEARRAY" via package "FOO" at - line 5. +######## + +# tied() should still work on tied scalars after glob assignment +sub TIESCALAR {bless[]} +sub FETCH {*foo} +sub f::TIEHANDLE{bless[],f} +tie *foo, "f"; +tie $rin, ""; +[$rin]; # call FETCH +print ref tied $rin, "\n"; +print ref tied *$rin, "\n"; +EXPECT +main +f |