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

PERL TO PYTHON TRAPS

There are quite a few traps for the unwary when migrating from Perl to Python in terms of the built-in function set. Primarily these relate to the way in which Python is object-oriented and therefore has class methods for certain operations that are covered by a Perl internal function – keys() and each(), for example. These traps apply as much to the built-in function set as to the methods on the base object types and other classes.

Other traps to look out for in all functions and methods, including the built-in ones dealt with in this chapter, are:

  • Python has no “scratchpad” variable ($_ in Perl) – if a function is expecting an argument and you don't supply one the interpreter will raise an exception.

  • Python functions return ...

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