I look at some of our Perl codebases and am puzzled by the use packageof some files.
We have a file containing useful functions functions.pl, which looks something like this:
package functions;
use strict;
sub function_a {
}
sub function_b {
}
package main;
sub function_c {
my ($arguments, $for, $this, $function) = @_;
package functions;
}
(The names of functions and packages are changed, obviously.)
The functions in this file are used in other scripts with require 'functions.pl', and then called &function_c()- because the scripts where it is called function_cdo not declare a package, they are supposedly in the namespace main, so don When you call it, function_cyou need to attach something before adding it.
function_a function_b , , , function_c , functions:: .
- , - script, , , ?
, Perl , package , , ?