Skip to content

Language record

Perl

Perl is read as packages: a `package` statement is the class, its subs are its methods, `use parent` and `with` become inheritance and role edges — and every edge that rests on less than a declaration carries a machine-readable reason, so confirmed and guessed edges can be told apart.

.pod, .pl, .pm, .t, .perl · 1 registry id · 11 of 14 relationship types

The registry row this page is generated from

Read at render time from the same family row the register reads, so nothing in this block can disagree with it.

Extensions
.pod, .pl, .pm, .t, .perl
Registry names
perl
Recorded symbols
packages · functions · methods

Relationship types this analyzer constructs

11 of 14 constructed, read from this analyzer's source and re-derived by the languages gate. Each row below is one of the engine's types, in the engine's own order.

Relationship typeConstructed
callsconstructed by this analyzer
extendsconstructed by this analyzer
implementsconstructed by this analyzer
usesconstructed by this analyzer
importsconstructed by this analyzer
exportsconstructed by this analyzer
containsconstructed by this analyzer
referencesconstructed by this analyzer
overridesconstructed by this analyzer
instantiatesconstructed by this analyzer
decoratesruled absent
rendersruled absent
mixes_inconstructed by this analyzer
part_ofruled absent

11 constructed, 3 not constructed. All 3 absent types are recorded as ruled absent: the written reason and the corpus measurement behind each are in this family's completeness record. The register explains what each label means.

What this analyzer does not resolve

  • An override is confirmed against a base the index can see, and the two outcomes are very lopsided: of 8,085 overrides edges on the corpus, 1,627 are confirmed at confidence 0.95 and 347 are first-parent guesses at 0.5, with 6,111 withdrawn — 75.6% of the edges the first version published. A guessed edge still names a method that exists, so it is present and marked rather than dropped.
  • Only the first base is followed. use parent 'A', 'B', an @ISA assignment and use Mojo::Base each record every parent they name and walk one, and a role composed with with becomes an implements edge while the methods it supplies are not merged into the consuming package.
  • The builtins list is derived rather than hand-written: the union of the fixed operator token sets the pinned grammar declares and the named-op entries in perl 5.38's own opcode header. Ten names were missing when it was first built, and say and system alone produced phantom call edges on one corpus.

Every line above was written against Perl’s own analyzer module and is named against a construct in it, so it can be checked against the source. Nothing here is inherited from a template, or from another language’s page.

Where you meet it in a repository

Recognised by extension — .pod, .pl, .pm, .t, .perl. Everything below is about where those files actually sit in a working repository.

  • A module's identity is its package name — package App::Queue; — the same string @ISA and ->isa speak in, so inheritance is answerable without loading anything.
  • The block form (package Outer { … }) scopes the package to its braces: a sub written after the block is back in the enclosing package, which is how perl itself behaves.
  • Declarative properties are read from the keyword rather than from an accessor: has 'name' => (is => 'ro') publishes a property on the package, and field $x; inside a 5.38 class body publishes one too — two spellings of the same declaration that produce one symbol.

Questions this index answers

Phrased as retrievals, because that is what an index can honestly do: it holds the symbols and the edges between them, and hands them back with the evidence attached.

  1. Which packages inherit from this base class?
  2. Which methods does this package define, and which subs are plain functions?
  3. Which call sites could not be resolved to a concrete sub, and why?
  4. Does this method actually override one that its base declares?

What the analyzer sees in code like this

A package, the base it declares, and the calls inside its method
package App::Queue;              # bb records: package App::Queue (a class)
use parent 'App::Worker';       # bb records: extends -> App::Worker

sub run {                        # bb records: method run on App::Queue
  my $self = shift;
  $self->{queue}->enqueue(@_);   # bb records: calls -> enqueue
}

# sub new is published under the name "constructor"

Symbols are stored with the file they came from and the bytes they span, so a hit points at a line rather than at a guess. The annotations in the sample are commentary for the reader, not strings the index would store.

Languages that turn up in the same repository

Scripting & shell — the count beside each name is how many relationship types that family’s analyzer constructs.

The extensions, registry names, recorded symbols and relationship types above are the parser registry row for Perl, read while the page rendered — the same row the register reads, so the two surfaces cannot tell two stories. Every relationship type listed as constructed appears in src/ast/real-*, the analyzer modules bb ships. bb 0.1.0 answers from a local store over 50 languages (53 registry ids, three of them aliases). There is no benchmark on this page: every claim here is one you can go and read in the source.