in reply to defining functions at runtime
Paladin is probably right about the quotes. On a more general note, rather than using the eval to create the sub on the fly you might consider assigning a CODEREF to the '*get_text' typeglob:
This is possibly a little clearer than the 'eval' ins some cases.*get_text = sub { # ... };
/J\
|
|---|