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

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

Replies are listed 'Best First'.
Re: how do i change the shell script to perl program
by merlyn (Sage) on May 07, 2001 at 18:27 UTC
    Step 1: learn Perl. Step 2: reverse engineer the script to figure out what it does. Step 3: write the script in Perl.

    There's really no simpler way.

    Originally posted as a Categorized Answer.

Re: how do i change the shell script to perl program
by strfry() (Monk) on Oct 06, 2001 at 01:04 UTC
    maybe try
    #!/usr/bin/perl -w use strict; my (@script) = <<SH; # Your shell script goes below this line echo "cool!" echo "perl does shell scripts, too?"; SH map { system $_; } @script;

    if it aint broke, don't fix it. (: seriously though, merlyn has the right of it. and one of the best ways to learn one language is to compare it to one you already know... and try to make the new do the nifty things you did in the old. (well, it's one of my favorite ways to learn, at any rate.)
    good luck,
    strfry()

    Originally posted as a Categorized Answer.

Re: how do i change the shell script to perl program
by Fletch (Bishop) on Oct 06, 2001 at 01:42 UTC

    There's also merlyn's sh2perl.

    Originally posted as a Categorized Answer.