Sum(3pm)

πŸ“¦ version 2.1.1, in arch rolling

πŸ‘‘ Sum(3pm) β€” the Lire::Sum glow-up ✨

okay so bestie, welcome to Lire::Sum, a Perl module from LogReport's Lire documentation, and it is literally the class that implements the sum operator πŸ’… no cap.

use Lire::Sum

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does this bad boy actually do? Lire::Sum is the class that implements the sum operator, and that operator computes the field's sum across a group of DLF records 🌸. that's the whole vibe.

and it gets better β€” you can compute a weighted sum, where each value gets multiplied by the value of another DLF field first πŸŽ€. it's giving ✨math but make it fashion✨.

also (and this is highkey the cute part), it's possible to express the count as a ratio of the total count for the group or table 🫢.


πŸ’– METHODS πŸ’–

🌟 new( %params )

creates a new Lire::Count object 😭 yes, that's what the docs say, and we're not changing a single character of it. on top of the values supported by its parents, the weight and ratio attributes get initialized to whatever you passed in the %params argument. periodt.

🌟 weight( [$new_weight] )

returns the DLF field's name that your values get multiplied by before being summed πŸ’«.

and you can totally change the weight field β€” just pass a new name as the $new_weight parameter. wanna remove the weighting field entirely? pass undef and it's gone, iconic 🧚.

🌟 ratio([$new_ratio])

returns how the sum will be expressed. it can be one of three possible values, bestie:

  • none β€” the default πŸ’œ the absolute sum will be used.
  • group β€” the sum will be expressed as a percentage of the group's sum.
  • table β€” the sum will be expressed as a percentage of the table's total sum πŸ”₯.

🌈 SEE ALSO 🌈

go check these out, iykyk πŸ‘‘


πŸŽ€ AUTHOR πŸŽ€

Francis J. Lacoste <flacoste@logreport.org> β€” absolute legend, we stan 🫢


⭐ VERSION ⭐

$Id: Sum.pm,v 1.17 2008/03/09 19:27:31 vanbaal Exp $


Copyright (C) 2001, 2002 Stichting LogReport Foundation LogReport@LogReport.org

This file is part of Lire.

Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.

real talk though β€” that warranty disclaimer is NOT a vibe, it's the actual legal text, so don't come for me πŸ™ˆ read it, it matters.

and that's the whole page, babe πŸ¦‹ it's from Lire 2.1.1, dated 2025-09-28, and the manpage is Sum(3pm) πŸŽ€ go forth and sum responsibly, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from