- or download this
# script.pl
use Module1;
use Module2;
- or download this
# Module1.pm
package Module1;
...
sub import { print("Module1 exporting to ". caller() . "\n"); }
print("Executing Module1\n");
1;
- or download this
# Module2.pm
package Module2;
...
sub import { print("Module2 exporting to ". caller() . "\n"); }
print("Executing Module2\n");
1;
- or download this
>perl script.pl
Compiling Module1
...
Executing Module1
Module1 exporting to main
Module2 exporting to main
- or download this
>perl script.pl | sort
Compiling Module1 --> once
...
Module1 exporting to main --> once per "use"
Module2 exporting to main \
Module2 exporting to Module1 --> once per "use"