Perl can be executed immediately without compiling, just like a shell script

Perl can run immediately without compiling, just like shell scripts (sh, bash, csh, ksh, zsh). One of the characteristics of a language called a scripting language is that it can be executed immediately without compiling.

Since the cycle of writing a program and executing it immediately can be taken, the production efficiency of program creation is high.

Executing a program in Perl

Execution of a program in Perl.

perl script.pl

Executing a program in a shell script

Executing a program in a shell script.

sh script.sh

In shell scripts, shebangs are often written, but in reality, the program is executed by the command that executes the shell.

What is the significance of being able to execute a program immediately?

What is the significance of being able to run a program as soon as you write it? The biggest advantage is that you can go through many cycles of writing, executing, and checking programs.

Write, execute, confirm. Write, execute, confirm. Write, execute, confirm. In actual system development, this cycle is repeated thousands and tens of thousands of times.

Since this cycle can be repeated quickly, the production efficiency of program development is high.

The ability to run Perl right away is built on the fact that shell scripts can run right away.

Perl is the ancestor of the modern scripting language, but its immediate execution is based on the functionality of shell scripts.

Perl is internally compiled into a syntax tree and then executed, but the perl command is designed to compile and execute into a syntax tree all at once.

This is in contrast to shell scripts, which execute line by line.

Perl checks the syntax for the entire program, and if there is a syntax error, it will result in a compilation error.

The compiled information is not output to the file, it only exists in memory. Since it is a series of compilation and execution in memory, it looks as if it is being executed without compilation. Compiling is done in a blink of an eye and is done right away.

Associated Information