Sort::MergeSort(3)
β¨ NAME β¨
okay bestie, welcome to Sort::MergeSort β the Sort::MergeSort(3) manual page, a User Contributed Perl Documentation situation β and itβs literally about merging pre-sorted input streams π
π«Ά SYNOPSIS π«Ά
the whole vibe is:
use Sort::MergeSort;
my $terator = mergesort($comparefunc, @iterators);
π DESCRIPTION π
okay so picture this: you hand mergesort() a comparison function plus a bunch of iterators that produce data that is already sorted, and mergesort() gives you back an iterator that produces sorted and merged data from all of the input iterators. iconic behavior, no cap β¨
Sort::MergeSort also works with filehandles. It doesnβt care. If the only input is a filehandle, it will return a filehandle. In all other situations it will return an iterator. periodt.
The $comparefunc takes two arguments. It does not use the implicit $a & $b that perl sort uses β so donβt come at it with sort-block energy, bestie π
The iterators are treated as file handles, so any filehandle or Sort::MergeSort::Iterator will do as input. iykyk π¦
πΈ EXAMPLE πΈ
bestie, itβs literally this:
use Sort::MergeSort;
π¦ SEE ALSO π¦
Sort::MergeSort::Iteratorβ go look at this too, bestie π
π LICENSE π
Copyright (C) 2008,2009 David Sharnoff. Copyright (C) 2013 Google, Inc.
This package may be used and redistributed under the terms of either the Artistic 2.0 or LGPL 2.1 license.
slay, legal edition π
mwah π this page is from perl v5.32.1, dated 2022-01-21 β Sort::MergeSort(3) β and thatβs the whole entire vibe. periodt. π
π¦ where this page comes from
- epel 9: perl-Sort-MergeSort 0.31-20.el9 Β· (Artistic 2.0 or LGPLv2) and (GPL+ or Artistic)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms