in reply to calling scalar from scalar. symlinks
sub SetDestination { my ($self, $class) = @_; $self->{destination} = do { no strict 'refs'; \&{"${class}::destination"} }; } sub ... { my ($self, ...) = @_; ... $self->{destination}->(...); ... }
In any case, this is poor design. Why not just pass $config?
sub SetDestination { my ($self, $config) = @_; $self->{config} = $config; } sub ... { my ($self, ...) = @_; ... $self->{config}->destination(...); ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: calling scalar from scalar. symlinks
by thezip (Vicar) on Oct 25, 2006 at 21:36 UTC | |
by ikegami (Patriarch) on Oct 25, 2006 at 21:37 UTC | |
by thezip (Vicar) on Oct 25, 2006 at 21:40 UTC |