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

MODULES

Modules in Python work in a slightly different way to Perl. We still import the modules, but modules can be imported in different ways, and once imported accessing the information within them is also different. However, if you've followed the notes so far on using Python objects and methods you'll begin to see a familiar pattern.

Namespaces

Python uses a very simple system for controlling the namespaces for importing modules. Python uses these namespaces in the same way as Perl uses packages (through the package statement). In Perl the package name for the main script is main and in Python —main—. The big difference between Perl and Python is how the namespaces affect how functions and objects in external modules are accessed.

In Perl, ...

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