in reply to How do I get to this 'simple' helper?
Simple fix you escape the $ for $t and $_ using \ before dollar sign
untestedmy @vars = ('instance1','instance2',..); foreach (@vars) { eval "sub $_ { my \$self = shift; if (@_) { \$self->{$_} = shift; } return \$self->{$_}; }"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I get to this 'simple' helper?
by AnomalousMonk (Archbishop) on Sep 03, 2010 at 01:49 UTC |