I would like to execute Perl commands contained in a string. The string in question may be any arbitrary Perl code as typed by user into a Tk Text widget.
This is for a data editor, so commands must execute in same main package as for the Tk widget which called it so as to act upon same vars, arrays and hashes as exist in said package.
I have tried 'exec' but it seems to execute independently, as if in some wholly different package. In Forth all that would be required is to make the string executable and call it. How would one accomplish such a feat in Perl?
In reply to Execute commands in a string by aplonis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |