in reply to Re: Chaining scripts smartly
in thread Chaining scripts smartly

Thanks for the help, gaal,

In principle, the scripts could be called in various situations, which is why I wrote them individually. They do relatively generic, simple things, like converting encodings, stripping lines, inserting XML fragments, and so don't really belong together in a single module. So using caller sounds like a good idea.

As to what happens between scripts: nothing. One script reads a file and writes another. This new file is read by the next script, and so on. So in the wrapper script I have to hard-code the names of the intermediate files, which seems somewhat clunky.

loris

Replies are listed 'Best First'.
Re^3: Chaining scripts smartly
by gaal (Parson) on Nov 11, 2004 at 12:51 UTC
    In that case, look at it this way: you have your standard unix toolkit. grep, find, sed, sort and so on; and you've added to it a number of new tools. That's fine and your choice to make them seperate is completely reasonable. Now, suppose you were to write a solution for a slightly different task, one that didn't have anything to XML or your current problem set. Would you use /bin/sh? Would you use Perl? In many cases either one makes sense... now you just have to make sure your tools aren't clunky, so you can use them with the same ease as you'd use grep and friends in a shell script. Making it possible to use standard input and output helps -- you can certainly pipe perl scripts with one another.