comparison Lib/IMPL/Config/Link.pm @ 58:a35b60b16a99

Configuration, late activation
author wizard
date Fri, 05 Mar 2010 20:14:45 +0300
parents
children 0f3e369553bd
comparison
equal deleted inserted replaced
57:bf59ee1cd506 58:a35b60b16a99
1 package IMPL::Config::Link;
2
3 use strict;
4
5 require IMPL::Exception;
6
7 require Tie::Scalar;
8 our @ISA = qw(Tie::StdScalar);
9
10 sub FETCH {
11 return ${$_[0]} = ${$_[0]}->instance() if UNIVERSAL::isa(${$_[0]},'IMPL::Config::Activator');
12 }
13
14 sub restore {
15 my ($self,$data,$surrogate) = @_;
16
17 my %args = @$data;
18
19 die new IMPL::Exception('A target is required for the link') unless exists $args{target};
20
21 return $self->new($args{target});
22 }