Any long chain of transformations depending on each other is a good candidate. F.ex I have been meaning to write a makefile for web galleries, ie a task where you take a large bunch of pictures and generate thumbnails and a batch of index pages — but only when a thumbnail doesn't already exist or only when there's new pictures to add to an index page, so that you can toss a few more pictures into the heap and regenerate the gallery without waiting an eternity for everything to be regenerated. Doing all the necessary checks in Perl to achieve that kind of statefulness is easy, but the code turns out messy. For make, this job is just natural.

A simply example would be my corefonts makefile. It was originally a nasty shell script. The makefile looks like a mouthful, but most of it amounts to “constants,” and the real code is just a few lines at the bottom and all the rest happens automagically and it won't redownlad or reextract files you already have.

Note that all of this works better the more self-contained the parts of your toolchain are. The recipe for each rule shouldn't be more than 2 or 3 lines for the majority of cases and should only rarely need to be more than even one. Then you just tell make how to assemble the machinery and it makes everything happen for you. Get to understand the tool well and it's just amazing.

Makeshifts last the longest.


In reply to When make trumps Perl (was: the disadvantages of mini-languages) by Aristotle
in thread the disadvantages of mini-languages by metaperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.