File::...:Modern(3pm)

πŸ“¦
version 4.201720 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ File::Util::Interface::Modern β€” the modern call interface to File::Util, bestie πŸ’…

okay so real talk, this is the File::Util::Interface::Modern page from the File::...:Modern(3pm) corner of the perl docs, and it is so short but so important. sit with me for a sec 🫢


🌸 VERSION

version 4.201720

that's it. that's the version. iconic, no notes ✨


πŸ¦‹ DESCRIPTION

So basically πŸ’– this module gives you a ::Modern-style interface for passing arguments to β€” and between β€” the public and private methods of File::Util. It's giving glow-up for your function calls.

Back in the day, the call syntax only worked like this:

some_method( main_arg => value, qw/ --opt=value --patern=^foo --flag / )

which, ngl, is a whole vibe of its own, but kind of giving 2010s πŸŽ€

This module lets File::Util work with calls that are way more consistent with current practices in Perl, like this:

some_method( main_arg => { arg => value, opt => value, flag => 1 } );
   -or-
some_method( '/var/log' => { match => [ qr/.*\.log/, qr/access|error/ ] } )

look at that. the args are just chilling in a hashref together. the way that flag => 1 just says "yes bestie, this is on" 😭 so clean. so slay. and that second one with '/var/log' and match taking an arrayref of qr/.*\.log/ and qr/access|error/?? chef's kiss πŸ‘‘

⚠️ Users, do not use this module by itself. It is intended for internal use only. fr fr, it's not a "you" module, it's a "File::Util's plumbing" module. iykyk 🚧

that's genuinely the whole page, bestie β€” short and sweet like a good qw// πŸ’€πŸ’–

this has been File::...:Modern(3pm) from the User Contributed Perl Documentation, running on perl v5.36.0, dated 2022-11-29 🌸 mwah, go read File::Util itself if you want the actual plot πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from