...I don't get the "why use Perl for this" attitude. Did anyone consider that this might have been an extract from a much larger Perl program?
And there's no good reason *not* to use Perl for this. Frankly, using Perl is just about the same as using a shell script. An interpreter must be invoked. And although Perl may weigh more than the chosen shell for a script, it's not much heavier.
Not to mention, as someone else pointed out, that if you solve it with a Perl script, you can take that to a number of other platforms.
...All the world looks like -well- all the world,
when your hammer is Perl.
---v