Feb 10, 2017, 12:48 PM
Post #7 of 9
Hmm, no, I don't know any such site (but maybe there are some, the only times I converted shell scripts to Perl, it was for doing things better (and faster), so the idea was to rewrite the shell script into Perl in a totally different way).
Re: [digioleg54] I have a smal question about global variables
[In reply to]
One background comment: essentially, shell scripts know only about global variables, so they are more or less bound to use global variable. That does not mean that your Perl script replacing a shell script should do the same. In fact, it is quite likely that it shouldn't (except possibly for true environment variables). But again, that's my personal conviction, this may not apply to your case. And it all depends on whether you are ready to really rewrite the application or only looking for some kind of (if possible partially automated) translation of shell into Perl.
Very recently, I made such a rewrite from shell to Perl. I replaced 900 lines of ksh and 150 lines of awk with less than 100 lines of Perl (running several times faster). But, as you can probably imagine, this was not translating shell into Perl, but it was a complete rewrite.