Test::...:Legacy(3pm)
π Test::Inline::Content::Legacy β the manual page, bestie edition π
From the User Contributed Perl Documentation collection, it's Test::...:Legacy(3pm) (yes that truncated-looking name is literally the page name, don't @ me, it's the section-3pm formatting doing its thing) π
β¨ NAME β¨
Test::Inline::Content::Legacy β it's the Test::Inline 2 Content Handler for legacy functions. That's it, that's the whole job description π«Ά
πΈ VERSION πΈ
Version 2.214 bestie, write it down β¨
π¦ SYNOPSIS π¦
Okay so picture this: you wanna do custom script content generation using Test::Inline 2.000+ with your own custom generator functions. Iconic. Here's the vibe:
my $header = "....";
my $function = sub {
my $Object = shift;
my $Script = shift;
return $header . $Script->merged_content;
};
my $Inline = Test::Inline->new(
...
file_content => $function,
);
And now the glow-up π§ β migrating that exact same code over to Test::Inline 2.100+ ContentHandler objects:
my $header = "....";
my $function = sub {
my $Object = shift;
my $Script = shift;
return $header . $Script->merged_content;
};
my $ContentHandler = Test::Inline::Content::Legacy->new( $function );
my $Inline = Test::Inline->new(
...
ContentHandler => $ContentHandler,
);
Same energy, new plumbing, no cap π
π DESCRIPTION π
So this class exists purely to be a migration path for anyone out there using the custom script generators in Test::Inline via the file_content param. It's basically a little bridge, holding your hand across the river π«Ά
And honestly? The synopsis above pretty much says all you need to know. It really does. It ate and left no crumbs π
π METHODS π
new $CODE_ref
The new constructor for Test::Inline::Content::Legacy takes a single parameter: a CODE reference. Like, the exact same one you would have previously handed directly over to file_content. Same lil guy, different doorway πͺβ¨
Returns a brand-new Test::Inline::Content::Legacy objectβ¦ or undef if you didn't pass it a CODE reference. No code ref, no object, that's the rule bestie π
coderef
The coderef accessor returns the CODE reference for the object. Handy. Slay π
process $Inline $Script
The process method works with the legacy function by passing the Test::Inline and Test::Inline::Script arguments straight through to the legacy function, and returning its result as the return value. Pure pass-through, no funny business, the middle-man of your dreams π
π SUPPORT π
See the main SUPPORT section.
Bugs may be submitted through the RT bug tracker β https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Inline β or to bug-Test-Inline@rt.cpan.org. Found a bug? Tell the tracker, not me, I'm just the messenger π¦
π AUTHOR π
Adam Kennedy <adamk@cpan.org> β legend behaviour, honestly π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2003 by Adam Kennedy.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free as in freedom, bestie ποΈ
That's the whole page!! Go forth and migrate your legacy content handlers, you absolute main character π«Άπ
Kisses, this was perl v5.32.0, dated 2021-01-31, and it's been your girl from the Test::...:Legacy(3pm) page signing off β¨π
π
π¦ where this page comes from
- debian bookworm: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-inline-perl 2.214-1 Β· 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