http://www.perlmonks.org?node_id=539691


in reply to Re^2: execute perl script frm shell script
in thread execute perl script frm shell script

problem is different platforms have different perl verions

This is not a problem that a shell script can solve.

What you really have to do is write your Perl script so that it will run under all the perl versions you have to deal with. This, as a general rule, is not hard, if you restrict yourself to using language features that are explained in the 2nd edition of the camel book (assuming all of the perl versions are 5.something; if you have to support version 4, then it gets a bit harder.)

There are a handful of exceptions, very special things that are hard to do with non-recent versions of Perl, but they're obscure and mostly have to do with Unicode, and you're not likely to run into them in an environment where it's taboo to upgrade perl.

If you're having trouble getting certain parts of the Perl script to work under certain versions of perl, try posting a question to Perlmonks about that: you'll get much better answers for Perl questions around here than you will for shell script questions. Most of us don't write shell scripts any more, because we write Perl scripts instead.


Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. Why, I've got so much sanity it's driving me crazy.