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

Chapter 5. FUNCTIONS

Functions in Python borrow more from C rather than Perl. Perl's approach to functions is to allow you to supply a list of arguments to any function and the entire list, including the contents of arrays or hashes supplied, are placed into the @_ variable. It's up to the function definition to decide what to do with the list of arguments that has been supplied and how to interpret the supplied list into the information the function needs.

There are a few minor problems with this approach, some of which have been resolved over the years. For example, there is no way to identify the types of arguments you expect, unless you use prototypes. When calling a function we are also limited to accepting a list of arguments or supplying ...

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