rahul has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on How do I convert tcshell scripts to perl ?

Replies are listed 'Best First'.
Re: How do I convert tcshell scripts to perl ?
by danger (Priest) on Feb 05, 2001 at 04:20 UTC

    Well, one possibility is something like:

    #!/usr/bin/perl -w use strict; exec('/bin/tcsh', '/path/to/yourshellscript'); __END__

    But the only real option is to learn enough Perl to re-implement your scripts in Perl, or find another human who can do so for you. There is no tcshell2perl converter. See this faq for further enlightenment.

Re: How do I convert tcshell scripts to perl ?
by a (Friar) on Feb 05, 2001 at 09:20 UTC
    As an interesting learning experience, writing a hack on that though isn't bad. I've written one for ksh and, I kid you not, dbase (surprisingly easy, that one). Yes, they were not good or complete, but helpful both in getting my old shell scripts to perl and in learning what I can/should be doing w/ perl. Mostly its just things like renaming variables, munging while/if stmts and tiding up the punctuation, not smoothing the logic. Now, I think I'd just start fresh (w/ 'use CGI;' at the top ;-) but then it quickly got me a bunch of perl to work on w/ a specific purpose; duplicate what my shell script was doing.

    a