http://qs1969.pair.com?node_id=846118


in reply to lost in my first Perl module

Like ikegami said, you probably just want to use DBI.

If you needed to write an object-oriented module, I'd recommend Moose, but it doesn't sound like you need to.

To get started (if you actually don't need an OO module), just create yourself a SybaseManip.pm file, put package SybaseManip; at the top of it, and start writing some subs to do your bidding. To use your code from a test script, just put this at the top of said script:

use lib 'path/to/where/SybaseManip.pm/lives'; use SybaseManip;

and start calling your functions.

Replies are listed 'Best First'.
Re^2: lost in my first Perl module
by Anonymous Monk on Jun 23, 2010 at 17:23 UTC

    Forgot to mention: when you call your functions in your test script (for the setup described above), you'll need to fully-qualify their names, as in: SybaseManip::my_func(...).

    And if you have any globals in your SybaseManip.pm file (as in: our $foobar = 'baz';), you can access them from your script similarly: $SybaseManip::foobar