Sort::MergeSort(3)

πŸ“¦
version 0.31 Β· 4 versions
, in epel 9

✨ 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