my $code = '$a = 2;'; # $a is meaningless here; it's just a string sub hi { my $a = 1; eval $code; print "$a\n"; # 2 }