in reply to Defining a module .....

Try something along the lines of this:-
Create a file say called Utils.pm
Package Utils; @EXPORT = qw(sub1 sub2); sub sub1 { Code for sub1 here return; } sub sub2 { Code for sub2 here return; }
Then when you want to use the module do the following:-
#!/usr/bin/perl -w use strict; BEGIN {push @INC, qq(/path/to/module/Utils);} use Utils;
You can then reference the subroutines as follows:-
&Utils::sub1(); &Utils::sub2();
Hope this makes sence.

Replies are listed 'Best First'.
Re: Re: Defining a module .....
by japhy (Canon) on May 12, 2001 at 18:25 UTC
    Using @EXPORT and @EXPORT_OK (etc.) are only needed and useful if you're also actually exporting symbols, often with Exporter.pm.

    Also, use lib "path" is generally preferred over manually push()ing to @INC.

    japhy -- Perl and Regex Hacker