Catman...:format(3pm)
β¨ Catmandu::Fix::format β the manual page, but make it cute β¨
okay bestie so we're looking at Catmandu::Fix::format, from the User Contributed Perl Documentation, and it's literally the glow-up your values have been waiting for π
π NAME π
Catmandu::Fix::format β swaps your value out for a formatted, sprintf-ish version of it. it's giving makeover montage π
πΈ SYNOPSIS πΈ
okay so here's the whole vibe, example by example:
# e.g. number: 41
format(number,"%-10.10d") # number => "0000000041"
# e.g. numbers:
# - 41
# - 15
format(number,"%-10.10d %-5.5d") # numbers => "0000000041 00015"
# e.g. hash:
# name: Albert
format(name,"%-10s: %s") # hash: "name : Albert"
# e.g. array:
# - 1
format(array,"%d %d %d") # Fails! The array contains only one value, but you request 3 values
# Test first if the array contains 3 values
if exists(array.2)
format(array,"%d %d %d")
end
not the array example calling you out in public π yes, format(array,"%d %d %d") Fails! because the array contains only one value but you're out here requesting 3 values. the audacity. so the fix is right there: test first if the array contains 3 values, then format. π«Ά
π¦ DESCRIPTION π¦
bestie, this fix creates a string formatted by the usual printf conventions of the C library function sprintf. that's the whole thing. the way that it just... hands the formatting over to sprintf and lets it cook π
want the full rundown? see <http://perldoc.perl.org/functions/sprintf.html> for a complete description. iykyk β¨
π SEE ALSO π
Catmandu::Fixsprintf
and that's the page, no cap π
this was pulled from the docs as of 2026-01-24, shipped with perl v5.40.1, and yes it's Catman...:format(3pm) at the bottom too, mwah π go format something iconic, bestie πβ
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms