LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is the difference between perl and shell scripting (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-difference-between-perl-and-shell-scripting-4175486499/)

iamtinski 12-01-2013 09:01 PM

What is the difference between perl and shell scripting
 
Hi Experts,

Can someone explain what is the difference between perl and shell scripting?

Thank you.

273 12-01-2013 09:23 PM

One is scripting using Perl the other is scripting using one of the many built-in scripting languages in the shell.
https://en.wikipedia.org/wiki/Perl
https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29
https://en.wikipedia.org/wiki/C_shell
...

jpollard 12-01-2013 10:32 PM

Quote:

Originally Posted by iamtinski (Post 5073651)
Hi Experts,

Can someone explain what is the difference between perl and shell scripting?

Thank you.

The difference is the target use.

The shell is primarily an interactive command function. It is only secondarily a programming interface for stored commands.

Perl CAN access commands... but it is awkward at doing so, and is not that flexible. And if you think the "system" library (or the back tics) are uses--- they are implemented using the shell, not perl. Both spawn off a /bin/sh (or bash) to actually process the command.

Perl is primarily a programming language. As such it has much more complete I/O (direct implementation of hash tables and files, hashes of arrays, arrays of hashes, hashes of hashes, arrays of arrays..., network access (both through the normal system calls and through modules), file access, even an object programming model. In addition, it has the possibility of directly accessing external libraries (given the proper interface definitions of course).

The perl interpreter can even be embedded within other applications.


All times are GMT -5. The time now is 01:23 AM.