---
name: "Class::Trait::Lib::TComparable"
section: "3pm"
platform: "linux"
package: "libclass-trait-perl"
version: "0.31-4.1"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/Class::Trait::Lib::TComparable"
---

# Class::Trait::Lib::TComparable(3pm)

Trait for adding comparison abilities to your object

## NAME

TComparable - Trait for adding comparison abilities to your object

## DESCRIPTION

This trait gives your object a wide range of comparison abilities through its overloading of the \<=\> operator.

## SUB-TRAITS

- **TEquality**

  ## REQUIRES

- **compare ($left, $right)**

  This method should return -1 if `$left` is less than `$right`, 0 if `$left` is equal to `$right`, and 1 if `$left` is greater than `$right`.

## OVERLOADS

- **\<=\>**

  ## PROVIDES

- **equalTo ($left, $right)**

  This fufills the requirement of the sub-trait TEquality.

## AUTHOR

Stevan Little \<stevan@iinteractive.com\>

## COPYRIGHT AND LICENSE

Copyright 2004, 2005 by Infinity Interactive, Inc.

\<http://www.iinteractive.com\>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
