in reply to Pragma-like package

import() has been mentioned, but if what you want to do is to selectively pull in only some methods and variables from the package into your namespace, you might want to look at the Exporter module, which provides an import for you which does just that.

This is the way people used to write reusable perl code, prior to the advent of the current OO style. It's not considered fashionable or good style these days, but it certainly does beat having repeated code in multiple scripts.

Replies are listed 'Best First'.
Re^2: Pragma-like package
by dave0 (Friar) on Aug 21, 2007 at 11:18 UTC
    import() has been mentioned, but if what you want to do is to selectively pull in only some methods and variables from the package into your namespace, you might want to look at the Exporter module, which provides an import for you which does just that.
    You might also want to take a look at Sub::Exporter instead. It's a newer, better way of manipulating the symbols exported by a module.