in reply to Re: construct variable name on the fly
in thread construct variable name on the fly
Whatever you posted before your update, or after, why no strict 'subs' has anything to do with the problem.What you want to mention is really 'refs'.
This works:
$thisname{'frank'} = 1; $thisname{'lee'} = 2; $hashname = 'thisname'; print keys(%$hashname);
This works:
use strict('subs'); $thisname{'frank'} = 1; $thisname{'lee'} = 2; $hashname = 'thisname'; print keys(%$hashname);
This does not work:
use strict('refs'); $thisname{'frank'} = 1; $thisname{'lee'} = 2; $hashname = 'thisname'; print keys(%$hashname);
|
|---|