1. Perl
  2. reading material

Perl is a familiar scripting language whose syntax is similar to C, Java, PHP, and JavaScript

Perl's grammatical structure isn't unique, it's similar and familiar to the popular languages C, Java, PHP, and JavaScript. Some people like something beautiful and wonderful, but others find it easier to use if it's similar.

if statement

The familiar if statement. It's separated by blocks, so it feels easy to distinguish it from the surrounding lines.

# Perl, C, Java, PHP, JavaScript
if (condition) {


while statement

What about while statement? This is also the same as if and is separated by blocks.

# Perl, C, Java, PHP, JavaScript
while (condition) {


for statement

for statement is the same and is surrounded by blocks.

# Perl, C, Java, PHP, JavaScript
for (initial value; condition; next value) {


Semicolon at the end of the sentence

In Perl, one executable statement is separated by a semicolon. It feels like a "break".

# Perl, C, Java, PHP, JavaScript
Execution statement;

Variable declaration

In Perl, make a variable declaration when using variable. With a variable declaration, it's easy to visually understand where the variable started.

# Perl
my $num = 1;

# C, Java
int num = 1;

# JavaScript
var num = 1

# PHP (not)
$num = 1


The output of the variable is the print function in Perl.

# Perl, PHP
print $num;

# C
printf("%s", str);

# Java

# JavaScript (not for browser language)

If you're familiar with other languages, Perl's syntax is similar and you'll find it easier to read.

Related Informatrion