BASIC STRUCTURE
Both Perl and Python share the same basic rules and layout, although there are some specific differences you need to be aware of. To recap on the major points of operation for Perl:
Scripts are executed sequentially, on a statement by statement basis.
Statements must be terminated by a semicolon, statements can be separated by new lines.
Blocks are delimited by braces.
Functions can be defined before or after you use them.
External modules are imported during the initial stages of execution to allow syntax and error checking (see The execution model for more information on the precise execution sequence).
Python's approach
Python follows a similar approach, although it will appear to many Perl programmers as being somewhat ambiguous: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access