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

Run::Parts - Offers functionality of Debian's run-parts tool in Perl.

VERSION

Version 0.03

SYNOPSIS

Run::Parts offers functionality of Debian's run-parts tool in Perl.

run-parts runs all the executable files named within constraints described below, found in the given directory. Other files and directories are silently ignored.

Additionally it can just print the names of the all matching files (not limited to executables, but ignores blacklisted files like e.g. backup files), but don't actually run them.

This is useful when functionality or configuration is split over multiple files in one directory.

Perhaps a little code snippet.

    use Run::Parts;

    my $rp  = Run::Parts->new('directory'); # chooses backend automatically
    my $rpp = Run::Parts->new('directory', 'perl'); # pure perl backend
    my $rpd = Run::Parts->new('directory', 'debian'); # uses /bin/run-parts

    my @file_list        = $rp->list;
    my @executables_list = $rpp->test;
    my $commands_output  = $rpd->run;
    ...

BACKENDS

Run::Parts contains two backend implementation. Run::Parts::Debian actually uses /bin/run-parts and Run::Parts::Perl is a pure Perl implementation of a basic set of run-parts' functionality.

Run::Parts::Debian may or may not work with RedHat's simplified shell-script based reimplementation of Debian's run-parts.

By default Run::Parts uses Run::Parts::Debian if /bin/run-parts exists, Run::Parts::Perl otherwise. But you can also choose any of the backends explicitly.

METHODS

new (Constructor)

Creates a new Run::Parts object. Takes one parameter, the directory on which run-parts should work.

run_parts_command

Returns the run-parts to run with the given command parameter

list

Lists all relevant files in the given directory. Equivalent to "run-parts --list".

test

Lists all relevant executables in the given directory. Equivalent to "run-parts --test".

run

Runs all relevant executables in the given directory. Equivalent to "run-parts".

SEE ALSO

run-parts(8), Run::Parts::Debian, Run::Parts::Perl

AUTHOR

Axel Beckert, <abe@deuxchevaux.org>

BUGS

Please report any bugs or feature requests to bug-run-parts at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Run-Parts. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Run::Parts

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2013 Axel Beckert.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.