18.3 Converting Shell Programs to PerlHeh. Thought there'd be a shell-to-Perl translator, eh? Nope. Many have asked for such a beast, but the real problem is that most of what a shell script does is not done by the shell. Most shell scripts spend practically all of their time calling separate programs to extract pieces of strings, compare numbers, concatenate files, remove directories, and so forth and so on. Converting such a script to Perl would either require understanding the operation of each of the called utilities, or leave Perl calling each of the utilities, which gains nothing.
So, the best you can do is stare at a shell script, figure out what it does, and start from scratch with Perl. Of course, you can do a quick-and-dirty transliteration, by putting major portions of the original script inside |
|