Run::Parts::Perl(3pm)

πŸ’– Run::Parts::Perl πŸ’–

okay bestie, so this is the pure Perl glow-up of Debian's run-parts tool β€” like, it's Run::Parts::Perl, a User Contributed Perl Documentation page (that's the (3pm) vibe, iykyk). she's version 0.09, she's iconic, and she's here to help you run stuff. ✨


🌸 SYNOPSIS 🌸

okay so picture this: it's a pure Perl reimplementation of the basic functionality of Debian's run-parts(8) tool. that's the whole thing. that's her. πŸ’…

so what does run-parts(8) actually do, you ask? she runs all the executable files named within the constraints described below, found in the given directory. and the other files and directories? silently ignored. not even a text back. ghosted. πŸ’€

and ALSO β€” plot twist β€” she can just print the names of all the matching files (not limited to executables, but she does ignore blacklisted files like e.g. backup files), without actually running them. just, like, a little window shopping. πŸ›οΈ

this is lowkey useful when your functionality or configuration is split over multiple files in one directory. she's a multitasker, she's a main character.

⚠️ real talk: this module is not thought to be used directly and its interface may change. like, don't get attached. if you want something stable, go see Run::Parts for a stable user interface. she's the committed one. 🫢

πŸŽ€ FILE NAME CONSTRAINTS πŸŽ€

here's where she gets ✨picky✨ and honestly? respect.

on unix-ish operating systems, the file name (but not the path β€” important!!) must match:

^[-A-Za-z0-9_]+$

i.e. it may not contain a dot. no dots. periodt.

on dos-ish operating systems, the file name without suffix must match:

^[-A-Za-z0-9_]+$

same deal β€” no dots. the suffix may contain alphanumeric characters and is not mandatory (she's chill like that). so the full regular expression that the file name including the suffix must match is:

^[-A-Za-z0-9_]+(\.[A-Za-z0-9]+)?$

and just so you know β€” Debian's run-parts(8) tool also offers to use alternative regular expressions as file name constraints. but that is not yet implemented in Run::Parts::Perl. she said "not yet" so she might. we're manifesting. πŸ¦‹


🧚 METHODS 🧚

πŸ’œ new (Constructor)

creates a new Run::Parts object. takes one parameter β€” the directory on which run-parts should work. that's it. that's the whole birth certificate. πŸ‘‘

πŸ’œ run_parts_command

executes the given action with the given parameters. she's doing it, she's executing, she's serving. πŸ”₯

πŸ’œ list

lists all relevant files in the given directory. equivalent to run-parts --list. returns an array. πŸ“‹

πŸ’œ test

lists all relevant executables in the given directory. equivalent to run-parts --tests. returns an array. πŸ§ͺ

πŸ’œ run

executes all relevant executables in the given directory. equivalent to run-parts --tests. returns an array. πŸƒβ™€οΈ


⭐ INTERNAL FUNCTIONS ⭐

🌈 dosish

returns true if ran on a dos-ish platform, i.e. MS-DOS, Windows or OS/2. yes bestie, the function is literally named dosish. she's not even sorry. πŸ’…


πŸ” SEE ALSO πŸ”


πŸ› BUGS πŸ›

okay so if you find any bugs or have feature requests, please report them to bug-run-parts at rt.cpan.org, or through the web interface at:

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Run-Parts

she WILL be notified, and then you'll automatically be notified of progress on your bug as changes get made. it's a whole mutual-notification situationship. you're in this together now. πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Axel Beckert <abe@deuxchevaux.org> β€” the icon, the legend, the blueprint.


this software is copyright (c) 2021 by Axel Beckert.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, honestly. legal and generous. 🫢


and that's the whole thing, bestie!! this was Run::Parts::Perl β€” perl v5.32.0, dated 2021-01-03, page Run::Parts::Perl(3pm) β€” tysm for reading, go run some parts, mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from