package Constraints::Variable; use strict; use warnings; sub new { my $class = shift; my ($name, $value) = @_; bless { -Name => $name, -Value => $value, }, $class; } sub useit { my $class = shift; my $varname = shift; no strict qw(refs); *{'main::'.$varname} = *{'Constraints::_AUTOVARS::'.$varname}; #eval qq{ # package main; # use vars qw(\$$varname); #} # Das use-vars-eval schein kein Unterschied zu machen } 1;