String::Parity(3pm)

String::Parity3pm

Parity (odd/even/mark/space) handling functions

Usage

 use String::Parity;
 use String::Parity qw(:DEFAULT /show/);

Overview

setEvenParity LIST

Copies the elements of LIST to a new list and converts the new elements to strings of bytes with even parity. In array context returns the new list. In scalar context joins the elements of the new list into a single string and returns the string.

setOddParity LIST

Like setEvenParity function, but converts to strings with odd parity.

setSpaceParity LIST

Like setEvenParity function, but converts to strings with space (High bit cleared) parity.

setMarkParity LIST

Like setEvenParity function, but converts to strings with mark (High bit set) parity.

EvenBytes LIST

Returns the number of even parity bytes in the elements of LIST.

OddBytes LIST

Returns the number of odd parity bytes in the elements of LIST.

SpaceBytes LIST

Returns the number of space parity bytes in the elements of LIST.

MarkBytes LIST

Returns the number of mark parity bytes in the elements of LIST.

isEvenParity LIST

Returns TRUE if the LIST contains no byte with odd parity, FALSE otherwise.

isOddParity LIST

Returns TRUE if the LIST contains no byte with even parity, FALSE otherwise.

isSpaceParity LIST

Returns TRUE if the LIST contains no byte with mark parity, FALSE otherwise.

isMarkParity LIST

Returns TRUE if the LIST contains no byte with space parity, FALSE otherwise.

showParity LIST

Like setEvenParity function, but converts bytes with even parity to 'e' and other bytes to 'o'. The function showParity must be imported by a specialised import list.

showMarkSpace LIST

Like setEvenParity function, but converts bytes with space parity to 's' and other bytes to 'm'. The function showMarkSpace must be imported by a specialised import list.

Notes

Don't use this module unless you have to communicate with some old device or protocol. Please make your application 8 bit clean and use the internationally standardised ISO-8859-1 character set.

Repository

<https://github.com/neilb/String-Parity>

Releases

11 releases since Debian 3.1 (Sarge); the text changed 3 times.

  1. 3.1–7
  2. 8
  3. 9–11
  4. 12–13

Author

This module was written by Winfried Koenig.

Updates to follow modern CPAN conventions by Neil Bowers (NEILB).

From libstring-parity-perl 1.34-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.