Diffrence b/w shell script and perl script

Hi,

Could anyone please tell me what are basic diffrence between a shell and a perl scipt i.e where to use shell scripting and where perl scripting? I want to know advantages of shell script over perl script and advantage of perl script over shell script.

Thanks,
Yogi

It is simple. Whatever you can do in shell, do in shell. If there is no way to do it in shell then use perl. If either of the two above is a major performance problem, then resort to C.

This sounds like homework - we do not support homework here.

I only want to voice one minor bit of dissent to Jim's opinion. If your shell scripts are running slow, then go to Perl. If your "Perl Script" can't cope either go to Perl Monks to get help tuning it or hire a programmer.

Jim is accurate in stating that C is lightning fast, but Perl is about 20 times faster than most shell scripts and is usually adequate for most admin's.

Plus, if written correctly, you can take a Perl script and move it to different architectures and it will still work. Not true of the C program, you will have to retain your source code and recompile on the new system.

Remember that shell scripts are portable as well and sometime a simple shell script is faster than perl script (ex. '#!/bin/ksh^Mcp "$1" "/tmp/x/$2"').