CPAN and Tooling Concepts
Import Lists
An import list describes which helpers a caller wants from a module.
import list
An import list names the helpers that should be made available to the caller.
Import Lists
import_lists.pl
Replay: real traced execution (multi-file project)
use strict;
use warnings;
my $wanted = "trim";
my @imports = ("trim", "slug");
my $found = "no";
foreach my $name (@imports) {
if ($name eq $wanted) {
$found = "yes";
}
}
print "wanted=$wanted\n";
print "found=$found\n";
use strict;
use warnings;
my $wanted = "slug";
my @imports = ("trim", "slug");
my $found = "no";
foreach my $name (@imports) {
if ($name eq $wanted) {
$found = "yes";
}
}
print "wanted=$wanted\n";
print "found=$found\n";
use strict;
use warnings;
my $wanted = "escape";
my @imports = ("trim", "slug");
my $found = "no";
foreach my $name (@imports) {
if ($name eq $wanted) {
$found = "yes";
}
}
print "wanted=$wanted\n";
print "found=$found\n";
$wanted ← trim, @imports ← 2, $found ← no
4my $wanted→ trim = "trim"; #@wanted="slug", "escape"5my @imports→ 2 = ("trim", "slug");6my $found→ no = "no";foreach my $name (@imports)
pass 1 of 28foreach my $nametrim (@imports2) {9 if ($name eq $wanted) {$found ← yes
8foreach my $name (@imports) {9 if ($nametrim eq $wantedtrim) {10 $found→ yes = "yes";11 }foreach my $name (@imports)
pass 2 of 28foreach my $nameslug (@imports2) {9 if ($name eq $wanted) {print "wanted=$wanted ";
14print "wanted=$wantedtrim\n";15print "found=$foundyes\n";outputwanted=trim found=yes
$wanted ← slug, @imports ← 2, $found ← no
4my $wanted→ slug = "slug";5my @imports→ 2 = ("trim", "slug");6my $found→ no = "no";foreach my $name (@imports)
pass 1 of 28foreach my $nametrim (@imports2) {9 if ($name eq $wanted) {foreach my $name (@imports)
pass 2 of 28foreach my $nameslug (@imports2) {9 if ($name eq $wanted) {$found ← yes
8foreach my $name (@imports) {9 if ($nameslug eq $wantedslug) {10 $found→ yes = "yes";11 }print "wanted=$wanted ";
14print "wanted=$wantedslug\n";15print "found=$foundyes\n";outputwanted=slug found=yes
$wanted ← escape, @imports ← 2, $found ← no
4my $wanted→ escape = "escape";5my @imports→ 2 = ("trim", "slug");6my $found→ no = "no";foreach my $name (@imports)
pass 1 of 28foreach my $nametrim (@imports2) {9 if ($name eq $wanted) {foreach my $name (@imports)
pass 2 of 28foreach my $nameslug (@imports2) {9 if ($name eq $wanted) {print "wanted=$wanted ";
14print "wanted=$wantedescape\n";15print "found=$foundno\n";outputwanted=escape found=no