Assuming you have use strict on like you should...
Then the following would allow you to access package variables declared with our (not with my).
our $var1; our $var2; sub get_var{ my ($self, $var_name) = @_; no strict 'refs'; return ${"$var_name"}; }
I'm really not sure why you would want to do that though.
In reply to Re: trouble with evaluate
by wind
in thread trouble with evaluate
by genghis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |