in reply to Re: Re (tilly) 3: How to call other programs
in thread How to call other programs
Also if you can you want to move the bulk of the functions in question into their own modules. When your script runs it can then load the module and call functions from there. Why?
OK, so it will separate code into different files, and that does tend to require more thought. The basic template I would suggest using looks something like this. If your module is MyStuff.pm, then start it like this:
And then you use it like this:package MyStuff; @ISA = 'Exporter'; @EXPORT_OK = qw(really neat functions here); use strict; # etc, including those neat functions 1; # An unfortunately necessary annoyance
This is your basic procedural module. While writing it, it is good to put some thought to how to reuse the functions elsewhere...use MyStuff qw(neat functions); # Whatever you actually need # Proceed to call "neat" and "functions like normal # functions. You only get the ones which you list. This # is a GOOD thing because it makes it easier to track down # which function came from where!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 5: How to call other programs
by Jonathan (Curate) on Feb 02, 2001 at 20:58 UTC |