in reply to Re: creating variables in a loop
in thread creating variables in a loop
merlyn's points aside, it's still broken because you still have a my inside your eval'd string and the lexical will disappear with the BLOCK of the enclosing for.
$ perl -le 'use strict; for( 1..2 ) { eval qq{my \$q$_ = $_}; }; print + $q1' Global symbol "$q1" requires explicit package name at -e line 1.
|
|---|