in reply to Defining a module .....
Then when you want to use the module do the following:-Package Utils; @EXPORT = qw(sub1 sub2); sub sub1 { Code for sub1 here return; } sub sub2 { Code for sub2 here return; }
You can then reference the subroutines as follows:-#!/usr/bin/perl -w use strict; BEGIN {push @INC, qq(/path/to/module/Utils);} use Utils;
Hope this makes sence.&Utils::sub1(); &Utils::sub2();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Defining a module .....
by japhy (Canon) on May 12, 2001 at 18:25 UTC |