in reply to Creating sub from string without munging the symbol table
for my $member (@constants){ my $thing; eval "sub $member" . '{ $thing = @_ ? shift : $thing }'; } [download]