The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Alien::Install::Util - Common utilities for Alien::Install roles and classes

VERSION

version 0.08_06

DESCRIPTION

This utility module provides some essential tools used by the various Alien::Install roles and classes.

FUNCTIONS

catfile

catdir

catpath

splitpath

splitdir

rootdir

 my $filename     = catfile $dir, $subdir, $filename;
 my $dirname      = catdir  $dir, $subdir, $dirname;
 my $filepathname = catpath $volume, $directories, $filename;
 my $dirpathname  = catpath $volume, $directories;
 my($volume, $directories, $filename) = splitpath $path;
 my($volume, $directories           ) = splitpath $path,1;
 my @dir          = splitdir $dir;
 my $root         = rootdir;

These functions work just like their File::Spec equivalent, except they are functions instead of class members, and on windows they use / instead of \ as a path separator (the latter can sometimes cause problems as it is also used as an escaping character).

spew

 spew $filename, $content;

Write the $content to the file specified by $filename.

slurp

 my $content = slurp $filename;

Read the $content from the file specified by $filename.

register_build_requires

 register_build_requires 'Foo::Bar' => 0;
 register_build_requires 'Foo::Baz' => 0.22;

Register a prerequisite for your class or role that is required for building your library.

This can be used by a Module::Build class to dynamically add building prerequisites if it determines the library is not available from the system.

register_system_requires

 register_system_requires 'Foo::Bar' => 0;
 register_system_requires 'Foo::Baz' => 0.22;

Register a prerequisite for your class or role that is required for finding your library from the system.

This is similar to register_build_requires above, though you should keep in mind most of the time these requirements will need to be available at configure time, and thus will need to be static requirements.

register_hook

 register_hook foo_event => sub {
   ...
 };

Register a hook for the given event. See individual roles for the events that they trigger. Generally hooks provided by roles are executed before hooks provided by classes.

config

 config name => 'value';

Set a configuration key/value pair. This required configurations vary depending on the roles your class is consuming.

SEE ALSO

Alien::Install

AUTHOR

Graham Ollis <plicease@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Graham Ollis.

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