in reply to Calling functions from other scripts
Here is a trivial example: This script uses say_hello:
#! perl -w use strict; use warnings; use mystuff; mystuff::say_hello "world";
... and say_hello is defined in this script, which should be saved as "mystuff.pm" in the same directory.
If you run the first script above with#! perl -w use warnings; use strict; package mystuff; sub say_hello { print "hello " . shift() . "\n"; } 1
it will print$ perl -w example.pl
hello world
|
|---|