Skip to Content
Perl To Python Migration
book

Perl To Python Migration

by Martin C. Brown
November 2001
Beginner
320 pages
5h 53m
English
Pearson Business
Content preview from Perl To Python Migration

THE BASICS

There are some basic rules that apply to all programming languages, such as how lines are formed, how we introduce comments, and how the core of the language such as statements and expressions are organized.

Line format

Python uses a very simple structure for the individual lines which make up your script. Semicolons, used in Perl to terminate each line, are optional. Instead, Python uses the normal line termination, linefeed and or carriage return to indicate the end of each statement:

print "Hello World!"
print "I am a test program"

The Python interpreter expects to see the correct line termination according to the platform you are working on – using a Unix-sourced script on a Mac without first translating the carriage returns ...

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.
Start your free trial

You might also like

Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Perl by Example

Perl by Example

Ellie Quigley
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe

Publisher Resources

ISBN: 0201734885Purchase book