> > Here are two solutions I found: > > > > $rec->{"loans:a_$fld" . "[$i]"} = $tmp{$fld} || ''; > > $rec->{"loans:a_$fld\[$i]"} = $tmp{$fld} || ''; > > > > Are there any other ways? Just curious. > > "loans:a_${fld}[$i]" also works. I like your second version > above best. > > $ perl -MO=Deparse,-q -e '"a_${fld}[$i]"' > 'a_' . $fld . '[' . $i . ']'; > > $ perl -MO=Deparse,-q -e '"a_$fld\[$i]"' > 'a_' . $fld . '[' . $i . ']';
Hmm you know that was the first thing I tried, but I always get this error, indicating it's still looking for @fld: I also have use strict on. C:\tmp>perl testadr Global symbol "@fld" requires explicit package name at testadr line 37. Global symbol "@fld" requires explicit package name at testadr line 43. BEGIN not safe after errors--compilation aborted at testadr line 48. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]