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