Perl::...version(3pm)

πŸ“¦
version 1.140 Β· 2 versions
, in ubuntu jammy

✨ NAME ✨

so this is Perl::Critic::Utils::DataConversion bestie πŸ’– β€” it's a little toolkit for converting from one type of data to another. like, it does exactly what it says on the tin, no plot twist πŸŽ€

(this page lives in the User Contributed Perl Documentation section, and the manpage header calls it Perl::...version(3pm) because manpage titles get squished, iykyk πŸ’…)


🌸 DESCRIPTION 🌸

it provides data conversion functions. that's it, that's the whole vibe. tiny module, big heart 🫢


πŸ‘‘ INTERFACE SUPPORT πŸ‘‘

okay so this is considered a public module, which means it's main character energy β€” it's officially part of the API πŸŽ€

any changes to its interface are gonna go through a deprecation cycle. so like, no surprise glow-ups that break your code. we're polite here πŸ’–

πŸ¦‹ IMPORTABLE SUBS πŸ¦‹

here's the roster, bestie. every single one, no skips ⭐

  • boolean_to_number( $value ) β€” returns 0 or 1 depending on how $value behaves in a boolean context. so it takes the vibe of $value and turns it into a literal number. true? 1. false? 0. slay 🌈
  • dor( $value, $default ) β€” returns $value or $default, and the deciding factor is literally just whether $value is defined or not. defined? you get $value. not defined? you get $default. simple as πŸ“
  • dor_n( $value0, $value1, ... ) β€” takes a whole squad of arguments and returns the first defined value among them. and if none of them is defined... it simply returns. yeah. that's the whole description. it just returns πŸ’€ (no fallback value, no drama, it's giving "I'm out" πŸ™ˆ)
  • defined_or_empty( $value ) β€” returns $value if it's defined, otherwise you get an empty string. so like, dor but the default is "" instead of something you chose ✨

πŸ’œ AUTHOR πŸ’œ

Elliot Shank <perl@galumph.com> β€” iconic, we stan 🫢


Copyright (c) 2007-2011 Elliot Shank. πŸ“œ

this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. the full text of this license can be found in the LICENSE file included with this module 🧚


and that's the whole page, bestie!! this was Perl::...version(3pm) from perl v5.32.1, dated 2021-10-15 πŸ’– go forth and convert your data types, no cap πŸŒŸπŸ‘‘πŸ’…

πŸ“¦ where this page comes from