ASPEER-MakeMaker
view release on metacpan or search on metacpan
lib/ASPEER/MakeMaker/MM/Util.pm view on Meta::CPAN
my $text = slurp($file);
```
Reads and returns the full contents of a file using `IO::File`. On failure,
calls `err`.
### blurp
```perl
blurp($file, $text);
```
Writes text to a file, replacing any existing content. Open, write, and close
failures call `err`.
### touch
```perl
touch($file);
```
Ensures a file exists. If the file is missing, creates it as an empty file.
### arg
```perl
my $param = arg(@args);
```
Parses the fixed argument sequence passed by generated make targets into a hash
reference. The recognized fields are:
- `NAME`
- `NAME_SYM`
- `DISTNAME`
- `DISTVNAME`
- `VERSION`
- `VERSION_SYM`
- `VERSION_FROM`
- `LICENSE`
- `AUTHOR`
- `TO_INST_PM`
- `EXE_FILES`
- `DIST_DEFAULT_TARGET`
- `SUFFIX`
- `ABSTRACT_FROM`
Any remaining values are stored in `ARGV_AR`.
The helper also derives:
- `TO_INST_PM_AR` from whitespace-splitting `TO_INST_PM`
- `EXE_FILES_AR` from whitespace-splitting `EXE_FILES`
### perlrun
```perl
my $command = perlrun($hook_object, $make_maker_object);
```
Builds the global Makefile `PERLRUN` command beginning with `$(PERL)`. It
includes non-default local `@INC` directories as `-I` options, loaded
`ExtUtils::*` modules as `-M` options, and the registered MakeMaker extension
classes in activation order. Modules are emitted once. When supplied, the
active MakeMaker object quotes `-I` arguments for the platform shell.
This value is installed into MakeMaker's `PERLRUN` macro by
`ASPEER::MakeMaker::MM::Import::const_config` and is reused by generated
targets.
## Usage Conventions
Functions in this module are intended for build-time helper code and generated
make target methods. New make target methods should use `arg` to decode their
calling arguments instead of reading positional values directly.
## See Also
- `ASPEER::MakeMaker`
- `ASPEER::MakeMaker::MM`
- `ASPEER::MakeMaker::MM::Import`
# AUTHOR
Andrew Speer <andrew.speer@isolutions.com.au>
# LICENSE and COPYRIGHT
This file is part of ASPEER::MakeMaker.
This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Full license text is available at:
<http://dev.perl.org/licenses/>
=end markdown
=head1 ASPEER::MakeMaker::MM::Util
=head2 Name
ASPEER::MakeMaker::MM::Util - shared utility functions for MakeMaker helpers
=head2 Synopsis
use ASPEER::MakeMaker::MM::Util;
msg('building %s', $name);
my $text = slurp($file);
blurp($file, $text);
my $param = arg(@make_target_args);
lib/ASPEER/MakeMaker/MM/Util.pm view on Meta::CPAN
=item -
C<LICENSE>
=item -
C<AUTHOR>
=item -
C<TO_INST_PM>
=item -
C<EXE_FILES>
=item -
C<DIST_DEFAULT_TARGET>
=item -
C<SUFFIX>
=item -
C<ABSTRACT_FROM>
=back
Any remaining values are stored in C<ARGV_AR>.
The helper also derives:
=over
=item -
C<TO_INST_PM_AR> from whitespace-splitting C<TO_INST_PM>
=item -
C<EXE_FILES_AR> from whitespace-splitting C<EXE_FILES>
=back
=head3 perlrun
my $command = perlrun($hook_object, $make_maker_object);
Builds the global Makefile C<PERLRUN> command beginning with C<$(PERL)>. It
includes non-default local C<@INC> directories as C<-I> options, loaded
C<ExtUtils::*> modules as C<-M> options, and the registered MakeMaker extension
classes in activation order. Modules are emitted once. When supplied, the
active MakeMaker object quotes C<-I> arguments for the platform shell.
This value is installed into MakeMaker's C<PERLRUN> macro by
C<ASPEER::MakeMaker::MM::Import::const_config> and is reused by generated
targets.
=head2 Usage Conventions
Functions in this module are intended for build-time helper code and generated
make target methods. New make target methods should use C<arg> to decode their
calling arguments instead of reading positional values directly.
=head2 See Also
=over
=item -
C<ASPEER::MakeMaker>
=item -
C<ASPEER::MakeMaker::MM>
=item -
C<ASPEER::MakeMaker::MM::Import>
=back
=head1 AUTHOR
Andrew Speer L<mailto:andrew.speer@isolutions.com.au>
=head1 LICENSE AND COPYRIGHT
This software is copyright (c) 2026 by Andrew Speer. It may be distributed
under the same terms as Perl itself.
=cut
( run in 2.764 seconds using v1.01-cache-2.11-cpan-4716db65a44 )