TSORT(1)
β¨ TSORT(1) β tsort (topological sort), bestie edition β¨
hey bestie! welcome to the TSORT(1) page from the User Contributed Perl Documentation β aka the tsort manual, and yes weβre gonna make topological sorting make sense. π
πΈ NAME πΈ
tsort β topological sort. Thatβs the name, thatβs the job, and itβs iconic. periodt. π
π¦ SYNOPSIS π¦
the whole invocation is literally just:
tsort [filename]
π DESCRIPTION π
OKAY so tsort does a topological sort of input pairs. It takes input from the standard input if you donβt provide a filename argument β no cap, stdin is the default bestie. π«Ά
For a more complete description, see the tsort(1) man page. For an explanation of the algorithm, see the Work column in the October, 1998, issue of SunExpert, or the references given below. β¨
π OPTIONS AND ARGUMENTS π
[-b|-d]β breadth-first or depth-first traversal; depth-first is the default. Choose your traversal vibe wisely. πfilenameβ optional input file. Input format is pairs of white-space-separated fields. Each field is the name of a node. Output is the topologically sorted list of nodes. π
π AUTHOR π
Jeffrey S. Haemer. Give him his flowers. π
π SEE ALSO π
Algorithm stolen from Jon Bentley (More Programming Pearls, pp. 20-23), who, in turn, stole it from Don Knuth (Art of Computer Programming, volume 1: Fundamental Algorithms, Section 2.2.3). the algorithm lore is real. πβ¨
π xoxo, your Perl bestie β this page is from perl v5.42.2, dated 2026-02-15. slay! π
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms