Catman...:vacuum(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

Catmandu::Fix::vacuum β€” bestie, this one deletes all the empty fields from your data. all of them. gone. bye πŸ’…

It's a Perl module, and it's a <em>Fix</em>, which means you drop it into your Catmandu fix pipeline and it just does its thing.</em>


🌸 SYNOPSIS 🌸

okay so picture this: you've got data with some absolutely dead-weight fields in it. empty string, empty array, empty hash β€” the whole sad little trio of nothingness. and then vacuum() rolls up and clears the room. 🧹✨

# Delete all the empty fields
#
# input:
#
# foo: ''
# bar: []
# relations: {}
# test: 123
#
vacuum()

# output:
#
# test: 123
#

see how foo, bar and relations were all sitting there contributing absolutely nothing to society? yeah. they're not invited anymore. the only survivor is test: 123, because 123 is a real one and it ate. πŸ”₯

so like, vacuum() takes no arguments β€” it's not that kind of girl, it needs no instructions β€” it just looks at your record and removes every field whose value is empty.


πŸ¦‹ SEE ALSO πŸ¦‹

  • Catmandu::Fix β€” the whole fix framework this lil guy lives inside. go read it, iykyk 🫢

and that's the whole page, no cap!! this one's from the User Contributed Perl Documentation, riding on perl v5.40.1, dated 2026-01-24. πŸ’– thanks for reading bestie, go forth and vacuum ur data, you're gonna slay πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from