use strict; package Object; sub new { bless {}, "Object" } sub foo { "ObjectFoo\n" } package Tied; sub TIESCALAR { my $class = shift; my $o = shift; bless \$o, $class; } sub FETCH { my $self = shift; print "<fetch>\n"; $self } sub foo { "TiedFoo\n" } package main; my $o = new Object(); print $o->foo(); tie $o, 'Tied'; print $o->foo(); untie $o; eval { print $o->foo() }; print "NoFoo\n" if $@;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The aftermath of an untie
by herveus (Prior) on Oct 02, 2001 at 07:30 UTC | |
by dws (Chancellor) on Oct 08, 2001 at 12:03 UTC |