Perl is a general purpose high level language popular for CGI scripts. Some of the popular projects in Perl are CPanel and Bugzilla. It was initially designed to replace complex shell scripts.
Python is a widely used general-purpose, high level programming language. Due to its rich library and support, it has wide applications in Web Development, Machine Learning, Desktop Applications, etc.
Perl does not care about whitespaces.
Python deals with whitespaces and a syntax error generates if whitespaces are not according to Python.
Perl accentuates support for common tasks such as report generation and file scanning.
Python accentuates support for common methodologies such as object-oriented programming and data structure design .
The .pl file extension is used to save Perl Scripts. For example myDocument.pl
The .py file extension is used to save Python Scripts. Example: myFile.py
End of Statement
All statements should end with a semi colon in Perl. Td >
It is not necessary to end the statements with a semi colon in Python as it deals with whitespaces.
Comments and Documentation td>
For Inline comments, we use # in Perl.
eg # Inline-Comment in Perl
whereas for documentation we use
= and = cut
eg = Documentation in Perl
starts from here and ends here. = cut
Python also uses # for Inline comments.
eg # Inline-Comment in Python
but for documentation we use
“” ”ie Three inverted commas
eg “” ”Documentation in Python
starts from here and ends here.” ””
Perl uses braces to mark the statement blocks.
Python use indentations to mark the statement blocks.
Some data types contained by Perl are numeric, string, Scalars, Arrays, Hashes.
Some data types contained by Python are numeric, strings, lists, dictionaries, tuples. td>