App::Parcimonie(3pm)

πŸ’– App::Parcimonie πŸ’–

okay so bestie, welcome to the App::Parcimonie page β€” it's part of the User Contributed Perl Documentation, and it's literally just the toolbox for the parcimonie program. no cap. it's giving "backstage pass to the main character". πŸŽ€


✨ SYNOPSIS ✨

honestly? go look at bin/parcimonie bestie, that's where the actual drama happens :)

See bin/parcimonie :)

🌈 EXPORT 🌈

nothing to see here, the export list is lowkey empty. moving on. πŸ’…

πŸ¦‹ SUBROUTINES πŸ¦‹

here's the whole squad of helper functions, one by one, no skipping, periodt.

pickRandomItems(N, @list)

gives you back a list of N unique items, picked at random out of whatever you passed in. so if you hand it a list, you get N lil chosen ones, no duplicates, fr fr. 🎲

gpg_is_v21()

sneaky little vibe check on the gpg binary sitting in your $PATH. it sniffs out which version you've got, and returns true iff it's 2.1 or newer. that's it, that's the whole function. πŸ‘‘

gpgPublicKeys()

returns the list of key fingerprints chillin' in the public keyring. πŸ”‘

Args, bestie:

  • $gnupg_options β€” a reference to a hash that gets passed to ->hash_init

gpgRecvKeys( $keyids, $gnupg_options )

imports the keys with the given key IDs straight from a keyserver. yes, we're fetching. we're networking. we're thriving. πŸ“₯

Args:

  • $keyids β€” reference to an array of key IDs
  • $gnupg_options β€” reference to a hash that gets passed to ->hash_init

checkGpgHasDefinedKeyserver

throws an exception if there's no keyserver defined in your GnuPG configuration. like, bestie, we can't fetch keys from nowhere. 😭

and when you're on GnuPG 2.x, a keyserver can be defined either in dirmngr's configuration or in good old gpg.conf β€” so yeah, we check both, because we're thorough like that. πŸ’…

averageLapseTime

Argument: the number of public keys in the keyring. returns the desirable average lapse time β€” in seconds, just to be clear β€” between two key fetches. ⏳


πŸ’€ heads up: checkGpgHasDefinedKeyserver doesn't just shrug, it throws. so wrap that call, bestie, or the exception is gonna be the main character of your script.

that's the whole page, i fear. 🫢 this doc was brought to you by perl v5.30.0 on 2020-04-25, and this little rewrite was served with so much love. stay random, stay unique, and go fetch those keys. mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from