Devel::...th_Table(3)
hey bestie, you're looking at Devel::...th_Table(3), aka the User Contributed Perl Documentation page for Devel::Cover::Truth_Table. It's giving truth tables for coverage objects and honestly? iconic. π
π NAME π
Devel::Cover::Truth_Table β truth tables for coverage objects.
β¨ VERSION β¨
This one is version 1.50. Periodt. π
πΈ SYNOPSIS πΈ
okay so here's the group-chat recap: load the module, build primitive truth tables, merge them, sort, and print. The exact code is literally this, no cap:
use Devel::Cover::Truth_Table;
# $a || $b
my $or_tt = Devel::Cover::Truth_Table->new_primitive('or_3', 0, 1, 1);
# $c && $d
my $and_tt = Devel::Cover::Truth_Table->new_primitive('and_3', 1, 0, 1);
# merge contents of $and_tt into right column of $or_tt, to create
# $a || ($c && $d)
$or_tt->right_merge($and_tt);
# get a (sorted) textual representation
my @text = $or_tt->sort->text;
print "$_\n" foreach @text;
__END__
A B C |exp|hit
--------------
0 0 X | 0 |---
0 1 0 | 0 |---
0 1 1 | 1 |+++
1 X X | 1 |+++
--------------
π¦ DESCRIPTION π¦
This module provides methods for creating and merging conditional primitives ("$a && $b", "$c || $d", etc.) into more complex composite expressions.
π METHODS π
new_primitive($op, @coverage)
Create a new truth table based on one of the built-in primitives, which are the subclasses of Devel::Cover::DB::Condition. $op is one of the following:
and_3β"and"or"&&"with three conditional paths.or_3β"or"or"||"with three conditional paths.or_2β"or"or"||"with two conditional paths. (i.e., when the right hand side of the expression is a constant)xor_4β"xor"with four conditional paths.
@coverage is a list of booleans identifying which of the possible paths have been covered.
sort()
Sorts a truth table (in place) and returns the sorted object. In-place glow-up, returned to you. β¨
text()
Format a truth table to an array of strings for printing.
html()
Format a truth table in HTML.
error()
The original page lists this method but doesn't give it a description β so we're not inventing one. It's here, bestie, and that's the whole tea. π΅
percentage()
Determines the proportion of possible conditions that have coverage.
right_merge($sub_table)
Merge entries from $sub_table into right column of table.
left_merge($sub_table)
Merge entries from $sub_table into left column of table.
π₯ SEE ALSO π₯
Devel::Cover β that's the one. Go read it, bestie. π
π BUGS π
None that I'm aware of...
π LICENSE π
Copyright 2002 Michael Carman <mjcarman@mchsi.com>
This software is free. It is licensed under the same terms as Perl itself. The latest version should be available from: https://pjcj.net
okay that's the whole page, bestie! π This footer moment is brought to you by perl v5.42.0, dated 2025-06-11, and the manual page Devel::...th_Table(3). Slay and goodbye! π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Devel-Cover 1.500.0-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Devel-Cover 1.500.0-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Devel-Cover 1.500.0-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Devel-Cover 1.500.0-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms