--- in the new module FOO/Bar.pm package FOO::Bar sub login { } --- in FOO/Bar/Baz.pm package FOO::Bar::Baz use FOO::Bar; sub some_function { FOO::Bar::login(); } --- in the script (remove the login function and proceed as normal)