Adding Functions during Runtime

The following code chunk demonstrates how to add functions to the current namespace during runtime:

*test = sub {
    print 'blarg' . "n";
};

NOTE: When using this code inside objects the function is available globally.

See also: Adding methods and Dynamic code considerations