March 2002 Perl Hardware Store 4

  1. Schwartzian Transform


    • Sort list of items by some non-apparent feature

    • Example: Sort filenames by last-modified date

    • Obvious method is very wasteful:

        sort { -M $b <=> -M $a } (readdir D);


Next Copyright © 2002 M-J. Dominus