App::Y...:Script(3pm)
π App::Yath::Script β bestie edition π
okay so real talk, this is App::Yath::Script, from the User Contributed Perl Documentation section of your friendly neighborhood perl man pages. it lives inside Test2::Harness and it's basically the little bouncer standing at the door of the yath script. let's get into it π«Ά
β¨ NAME β¨
App::Yath::Script β script initialization and utility functions for Test2::Harness, no cap π
πΈ SYNOPSIS πΈ
the yath script literally uses this module as its entry point, like that's the whole job:
#!/usr/bin/perl
use strict;
use warnings;
BEGIN {
return if $^C;
require App::Yath::Script;
App::Yath::Script::do_begin();
}
exit(App::Yath::Script::do_runtime());
π¦ DESCRIPTION π¦
so this module is the initial entry point for the yath script. it's the one handling script discovery, configuration loading, version detection, and then hand-off to version-specific script modules β those live at App::Yath::Script::V{X} π
during the BEGIN phase, do_begin() goes and locates .yath.rc and .yath.user.rc config files, figures out which harness version to use, and delegates to the right App::Yath::Script::V{X} module. then at runtime, do_runtime() passes execution off to that module. that's the whole vibe π₯
π Version Detection π
a version can come from any of these sources, and yes the order matters β this is priority order, bestie:
- an explicit
V#/v#as the first CLI argument - the rc files found walking upward from the cwd
- a working-copy checkout under
./lib/App/Yath/Script/V#.pm - finally, the highest
App::Yath::Script::V#module installed in@INC
and here's the tea β V0 is reserved for script validation, it is never auto-selected, and it must be requested explicitly. periodt.
when walking upward, each directory gets scanned in this order:
- A
.yath.rcsymlink whose target filename matches.yath.v#.rc/.yath.V#.rcβ the version gets extracted from the target name. this is so projects can keep a stable.yath.rcname while pointing at the versioned file. iconic, honestly. - Explicitly versioned files
.yath.v#.rc/.yath.V#.rcβ the highest version present in the directory wins, both for the chosen rc file and the captured version. - A plain
.yath.rc(not a symlink to a versioned file) β the rc file is used but no version is captured; the caller falls through to the checkout /@INCsources above.
the exact same priority applies to user-level configuration (.yath.user.rc / .yath.user.v#.rc) π
now if both project-level and user-level rc files capture a version? the user-level version takes precedence. that's so individual devs can override the project-level version when they need to. slay, honestly π
and when an explicit V# is given on the CLI, the lookup prefers a matching versioned rc file β but it falls back to a plain .yath.rc / .yath.user.rc if no versioned file is found. flexible queen π
π« PRIMARY API π«
these are the main entry points the yath script actually uses:
do_begin()β called duringBEGIN. it discovers the script path, injects include paths, loads.yath.rc/.yath.user.rcconfiguration files, figures out the harness version, and delegates toApp::Yath::Script::V{X}->do_begin(...). the whole opening act π¬$exit = do_runtime()β called afterBEGIN. it delegates toApp::Yath::Script::V{X}->do_runtime()and returns the exit code. that's it, that's the function β¨
π EXPORTS π
okay so all exports are optional (via Importer), nobody's forcing anything on you π«Ά
$script_file = script()β returns the path to the currently executing script file. where am i? this function knows.$yath_module = module()β returns the name of the currently loadedApp::Yath::Script::V{X}module. identity check πdo_exec(\@argv)β re-executes the current script with the given arguments. it sets theT2_HARNESS_INCLUDESenvironment variable to preserve the current@INC. so it keeps the receipt of where everything came from π§Ύ$clean_path = clean_path($path)/$clean_path = clean_path($path, $absolute)β converts a path to an absolute, normalized form. by default it resolves symbolic links usingrealpath. pass a false second argument to skip realpath resolution. choose your fighter β¨$full_path = find_in_updir($file)β searches for a file starting from the current directory and moving up through parent directories until it's found. returns the full path to the file, orundefif it's not found. if you're lost, it'll find you πΈ$file = mod2file($mod)β converts a module name (e.g.,App::Yath::Script) to a file path (e.g.,App/Yath/Script.pm). glow-up transformation π
π SOURCE π
the source code repository for Test2-Harness can be found at <http://github.com/Test-More/Test2-Harness/> β go look, bestie π
β MAINTAINERS β
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
Copyright Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://dev.perl.org/licenses/>
and that's the whole page, babes π this was perl v5.40.1, dated 2026-05-10, and yep, it really is App::Yath::Script(3pm) from your User Contributed Perl Documentation. go forth and yath responsibly π«Άβ¨π
π¦ where this page comes from
- ubuntu stonking: libapp-yath-script-perl 2.000016-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms