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

PYTHON BACKGROUND

Python's original development was somewhat different. From its inception Python was designed as an object-oriented language. The basic data types, which closely mirror Perl's in most respects, are all objects. The reliance on objects means that mentally, even for basic operations, you need to think not in terms of functions and operators, but methods instead. As a quick example, to get the keys from a hash in Perl you use:

@keys = keys %hash;

but in Python (where hashes are called dictionaries) we do:

keys = dict.keys

Aside from talking to files (which Python treats as objects, and therefore has its own sequence of methods), all other operations, including regular expressions, network access, and communication with the operating ...

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