PPI::St...cheduled(3)

✨ PPI::Statement::Scheduled ✨

okay bestie, gather round, we're talking about PPI::Statement::Scheduled β€” a scheduled code block, fr fr. it's a Perl module, it lives in the PPI:: family, and it is exactly what it says on the tin πŸ’…


🧬 INHERITANCE 🧬

the family tree is giving very much royal lineage πŸ‘‘ so here it is, verbatim, don't @ me:

PPI::Statement::Scheduled
isa PPI::Statement::Sub
    isa PPI::Statement
        isa PPI::Node
            isa PPI::Element

so yeah, she's a PPI::Statement::Sub, which is a PPI::Statement, which is a PPI::Node, which is a PPI::Element. four generations of iconic behavior, no cap 🌈


πŸ“– DESCRIPTION πŸ“–

a scheduled code block is one that is intended to be run at a specific time during the loading process. like, it's got a schedule. it's booked. it's got plans that night and it WILL be attending πŸ—“οΈβœ¨

there are five types of scheduled block, and yes we're listing all five because the way that i would simply never leave one out:

BEGIN {
      # Executes as soon as this block is fully defined
      ...
}

CHECK {
      # Executes after overall compile-phase in reverse order
      ...
}

UNITCHECK {
      # Executes after compile-phase of individual module in reverse order
      ...
}

INIT {
      # Executes just before run-time
      ...
}

END {
      # Executes as late as possible in reverse order
      ...
}

look at them. five little icons πŸŽ€ BEGIN, CHECK, UNITCHECK, INIT, END. each one with its own moment in the timeline. the commitment to scheduling is honestly aspirational.

technically β€” and this is the plot twist 🫒 β€” these scheduled blocks are actually subroutines, and in fact may have 'sub' in front of them. so like, sub BEGIN { } is a whole vibe that exists in the wild.


πŸ› οΈ METHODS πŸ› οΈ

πŸ” type

the "type" method returns the type of scheduled block, which should always be one of 'BEGIN', 'CHECK', 'UNITCHECK', 'INIT' or 'END'.

that's it. that's the method. it tells you which one you're looking at. lowkey the most honest method in the whole codebase 🫢


πŸ“ TO DO πŸ“

  • Write unit tests for this package

yeah. that's the whole to-do list. one item. the honesty?? the vulnerability?? i'm obsessed 😭 someone get this package its unit tests please, it deserves them πŸ’–


πŸ†˜ SUPPORT πŸ†˜

See the support section in the main module.

(i'm not making it up, that's literally where the support lives β€” go check the main module bestie, iykyk πŸ’œ)


πŸ‘‘ AUTHOR πŸ‘‘

Adam Kennedy <adamk@cpan.org>

absolute main character energy, thank you for your service 🫑✨


Copyright 2001 - 2011 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

so like, it's free, it's Perl-licensed, it's all above board. read the LICENSE file if you want the whole lore πŸ“œ


and that's the whole page, bestie!! this doc is perl v5.42.0, dated 2026-01-17, straight out of the User Contributed Perl Documentation collection β€” go forth and schedule your blocks responsibly, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from