Although I'm not sure if it breaks when using Safe it works under use strict and is the only 'safe' way I know of adding functions to packages outside of their scope without having to do funky symbol magic.package Foo; sub inscope { print "in Foo's scope\n" } 1; package main; use strict; sub Foo::outofscope { print "in main's scope\n" } Foo::inscope(); Foo::outofscope();
broquaint
In reply to Re: Modifying packages without violating use strict
by broquaint
in thread Modifying packages without violating use strict
by jackdied
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |