Created
May 22, 2010 15:03
Revisions
-
tom-lpsd created this gist
May 22, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ package Foo; use 5.010; use strict; use warnings; sub TIESCALAR { my $class = shift; bless \(my $init = "initial value"), $class; } sub FETCH { my $self = shift; return $$self; } sub STORE { my $self = shift; $$self = shift; } sub foo { say "foo"; } package main; use 5.010; use strict; use warnings; my $f = tie my $foo, 'Foo'; say $foo; $f->foo; (tied $foo)->foo;