I've wanted to do this before. That is just one reason why I want to be able to write: eval "my \$$bar;" if $workAround BEGIN; where the statement-modifier BEGIN prevents the introduction of a new scope and stringy eval is changed to (be able to) avoid introducing a new level of scope.
But I'd probably do what you want with something like:
I think. - tye (but my friends call me "Tye")my $code= <FILE>; eval "my \$$bar;\n#line 1 "file"\n$code"; die $@ if $@;
In reply to (tye)Re: creating dynamically named 'my' variables
by tye
in thread creating dynamically named 'my' variables
by ajwans
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |