in reply to How to call a perl function without its context?
You could make a package that doesn't reference anything else. Slap a function in the object and call it.
package MyIsolatedFunction; my $singleton = undef; sub new { my( $class ) = @_; return $singleton if defined $singleton; my $self = 0; $singleton = bless \$self, $class; return $singleton; } sub isolatedFunction { ... # Normal function stuff here. } 1;
|
|---|