in reply to Re: using strict refs
in thread using strict refs

The eval version works, the other version doesn't work because symbolic references only work for package variables - not for lexical variables declared with my. So:

#!/usr/bin/perl -w use strict; my $i = "test"; # this is now a package variable and requrires an explicit # package name because of use strict $main::test = "success"; { no strict 'refs'; print "$$i\n"; }

-- Hofmator