Tie::Array::Sorted::Lazy(3pm)

Tie::Array::Sorted::Lazy3pm

An array which is kept sorted

Usage

        use Tie::Array::Sorted::Lazy;
        tie @a, "Tie::Array::Sorted::Lazy", sub { $_[0] <=> $_[1] };
        push @a, 10, 4, 7, 3, 4;
        print "@a"; # "3 4 4 7 10"

Overview

This is a version Tie::Array::Sorted optimised for arrays which are stored to more often than fetching. In this case the array is resorted on retrieval, rather than insertion. (It only re-sorts if data has been modified since the last sort).

        tie @a, "Tie::Array::Sorted::Lazy", sub { -s $_[0] <=> -s $_[1] };

Releases

10 releases since Debian 4.0 (Etch); the text changed 4 times.

  1. 4.0
  2. 5.0–8
  3. 9–10
  4. 11
  5. 12–13

From libtie-array-sorted-perl 1.41-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.