in reply to Stupid Question
Let's say you have a function for logging and a function for carrying out some kind of calculation. Make a file called whatever.pm, and in it include:
So in your scripts, you can just do:package whatever; sub log { # do logging } sub calculate_something { # do calculations } return 1; # Perl insists on this :-)
#!/usr/bin/perl # Tells Perl to look in current dir for modules, may not # be necessary. unshift @INC, "."; use whatever; # the file must have .pm ext for 'use' whatever::log("Log file entry"); $answer = whatever::calculate_something();
|
|---|