build:...::Utils(3pm)

πŸ’– NAME πŸ’–

Wx::build::Utils β€” it's the utility routines page, bestie. Little helper functions that do the behind-the-scenes grunt work. Perl contrib docs, you know the vibe.


✨ SUBROUTINES ✨

πŸ¦‹ xs_dependencies

my %dependencies = xs_dependencies( $mm_object, [ 'dir1', 'dir2' ] );

Okay so you hand it a $mm_object and a list of dirs (as an array ref, [ 'dir1', 'dir2' ]), and it gives you back a %dependencies hash. That's the whole thing. Slay. πŸ’…

πŸŽ€ obj_from_src

my @obj_files = obj_from_src( 'Foo.xs', 'bar.c', 'cpp/bar.cpp' );

This one is giving glow-up energy for source files β€” it takes your source file names and works out the corresponding object file names. In scalar context it just returns the first file, so don't come at it expecting the whole list if you're not in list context. πŸ™ˆ

🌸 write_string, write_file

write_string( 'file', $scalar );
write_file( 'file', $scalar );

These two? Literally like File::Slurp. You give it a filename and a scalar, it writes the string out to that file. Besties fr fr. 🫢

⭐ read_file

my $string = read_file( 'file' );

Reads the file, hands you the string back. Iconic, no notes. πŸŽ€

πŸ’œ lib_file, arch_file, arch_auto_file

my $file = lib_file( 'Foo.pm' );          # blib/lib/Foo.pm     on *nix
my $file = lib_file( 'Foo/Bar.pm' );      # blib\lib\Foo\Bar.pm on Win32
my $file = arch_auto_file( 'My\My.dll' ); # blib\arch\auto\My\My.dll

Look at the slashes doing their little platform serve β€” *nix gets forward slashes, Win32 gets backslashes, and the output lands in the blib tree. πŸ‘‘

⚠️ Important rule, no cap: all input paths must be relative, but your output paths may be absolute. Don't mix that up or the vibe check fails.
my $file = path_search( 'foo.exe' );

It searches PATH for the executable you name. That's it. That's the function. πŸ’«

🌈 files_with_constants

my @files = files_with_constants;

Finds files containing constants. Short king of a subroutine. πŸ“

πŸ”₯ files_with_overload

my @files = files_with_overload;

Finds files containing overloaded XS/Perl subroutines. Periodt. πŸ’…


and that's the whole page, bestie!! πŸ¦‹βœ¨ This one comes courtesy of the User Contributed Perl Documentation β€” yeah, we're reading build:...::Utils(3pm) β€” from perl v5.42.3, dated 2026-08-20. Go off, utility routines. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from