imo, if you want to run it as a cron job, it's worth making it into a script so that you don't have to lose one of your two main quoting mechanisms in just writing the program.
Also, you will have to be aware of shell-based quoting and interpolation rules as a first layer of evaluation before your perl program gets to it. For example if you had a variable called $HOSTNAME, it would not start out undefined on unix systems. It wouldn't even get to perl still being a variable - unless you start backslashing(cancelling) the $. Basically all $s. And if you want to print one, you start to have to worry about whether you want to backslash the backslash that comes before the backslashed $ (you do, IIRC.)
Unless you take pleasure in excessive unnecessary complication (a common affliction in these halls, I know,) I say write a short script if at all possible, and just call it from cron. This way you can use the full range of quoting mechanisms the shell offers you to express your search and replace terms.
- d