For me, the whole point of perl is to be able to forget this
Unix stuff by getting inside one hood. Perl is the (almost) the same on every platform.
And the effort to learn perl is offset by being able to
forget this myrad of Unix commands with myriad of options that
are supported or not on a given platform. Also there is
often overhead avoided by perl.
In the case at hand, we have
to fork and pipe (no big deal) and sort (this last can cost
if the processed file is very big)
But again, TMTOWTDI.
--
stefp -- check out TeXmacs
wiki