only once per file. A Schwartzian transform involves the functional idiom described above, which does not use temporary arrays. The same algorithm can be written procedurally to better illustrate how it works, but this requires using temporary arrays, and is not a Schwartzian transform. The following example pseudo-code implements the algorithm in this way: for each file in filesArray insert array(file, modificationTime(file)) at end of transformedArray function simpleCompare(array a, array b) { return a[2] < b[2] } transformedArray := sort(transformedArray, simpleCompare) for each file in transformedArray insert file[1] at end of sortedArray History The first known online appearance of the Schwartzian transform is a December 16, 1994 posting by Randal Schwartz to a thread in comp.unix.shell Usenet newsgroup, crossposted to comp.lang.perl. (The current version of the Perl Timeline is incorrect and refers to a later date in 1995.) The thread began with a question about how to sort a list of lines by their "last" word: adjn:Joshua Ng adktk:KaLap Timothy Kwong admg:Mahalingam Gobieramanan admln:Martha L. Nangalama Schwartz responded with: #!/usr/bin/perl require 5; # New features, new bugs! print map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [$_, /(\S+)$/] } <>; This code produces the result: admg:Mahalingam Gobieramanan adktk:KaLap Timothy Kwong admln:Martha L. Nangalama adjn:Joshua Ng Schwartz noted in the post that he was "Speak[ing] with a lisp in Perl", a reference to the idiom's Lisp origins. The term "Schwartzian transform" itself was coined by Tom Christiansen in a follow-up reply. Later posts by Christiansen made it clear that he had not intended to name the construct, but merely to refer to it from the original post: his attempt to finally name it "The Black Transform" did not take hold ("Black" here being a pun on "schwar[t]z", which means black in German). Comparison to other languages Some other languages provide a convenient interface to the same optimization as the Schwartzian transform: In Python 2.4 and above, both the function and the in-place method take a parameter that allows the user to provide a "key function" (like in the examples above). In Python 3 and above, use of the key function is the only way to specify a custom sort order (the previously supported parameter that allowed the user to provide a "comparison function" was removed). Before Python 2.4, developers would use the lisp-originated decorate–sort–undecorate (DSU) idiom, usually by wrapping the objects in a (sortkey, object) tuple. In