1 |
## ---------------------------------------------------------------------- |
2 |
## $Id: Ref.pm,v 1.1 2003/01/22 17:59:22 root Exp $ |
3 |
## ---------------------------------------------------------------------- |
4 |
## $Log: Ref.pm,v $ |
5 |
## ---------------------------------------------------------------------- |
6 |
|
7 |
|
8 |
package Data::Code::Module; |
9 |
|
10 |
use strict; |
11 |
use warnings; |
12 |
|
13 |
|
14 |
use Data::Dumper; |
15 |
|
16 |
sub eval_vars { |
17 |
my $self = shift; |
18 |
my $module = shift; |
19 |
my $varnames = shift; |
20 |
|
21 |
$self->load("/Data/Code/Scalar"); |
22 |
$self->eval("use $module;", $varnames); |
23 |
|
24 |
# FIXME!!! this just works if $varnames contains a single, scalar variable name |
25 |
# enhance this (Data::Code::Module) and/or Data::Code::Scalar to get this working properly!!! |
26 |
my $result = $self->eval("return \$$varnames;"); |
27 |
|
28 |
# trace |
29 |
#print Dumper($result); |
30 |
#exit; |
31 |
|
32 |
return $result; |
33 |
|
34 |
} |
35 |
|
36 |
1; |
37 |
__END__ |