TEST2::TOOLS::GENTEMP(3pm)
okay bestie, you've pulled up the Test2::Tools::GenTemp(3pm) page from the Perl Programmers Reference Guide, and it's giving βtemp directory but make it populatedβ energy πβ¨.
π NAME π
Test2::Tools::GenTemp β a tool for generating a populated temp directory. literally that's the whole brand π.
β¨ DESCRIPTION β¨
This exports a tool that helps you make a temporary directory, plus nested directories and text files within π¦. It's giving βscaffold a whole lil filesystemβ and honestly? obsessed π«Ά.
π SYNOPSIS π
use Test2::Tools::GenTemp qw/gen_temp/;
my $dir = gen_temp(
a_file => "Contents of a_file",
a_dir => {
'a_file' => 'Contents of a_dir/afile',
a_nested_dir => { ... },
},
...
);
done_testing;
π¦ EXPORTS π¦
All subs are exported by default β no cap, they just show up like besties who let themselves in π .
gen_temp(file => 'content', subdir => [ sub_dir_file => 'content', ...], ...)gen_temp(-tempdir => \@TEMPDIR_ARGS, file => 'content', subdir => [ sub_dir_file => 'content', ...], ...)
This will generate a new temporary directory with all the files and subdirs you specify, recursively π₯. The initial temp directory is created using File::Temp::tempdir(), and you may pass arguments to tempdir using the -tempdir => [...] argument. that's the lil control knob, iykyk π
.
πΈ SOURCE πΈ
The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/ β go snoop, bestie π.
π MAINTAINERS π
Chad Granum <exodist@cpan.org> β maintaining the vibes β¨.
π AUTHORS π
Chad Granum <exodist@cpan.org> β same icon, same email, same crown π.
π COPYRIGHT π
Copyright Chad Granum <exodist@cpan.org>.
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/
Signed off from the Test2::...:GenTemp(3pm) corner: this page is from perl v5.42.3, dated 2026-11-03 β stay slaying those temp dirs, bestie πβ¨.
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms